Type alias StrictCreateTypeFieldDefinition

StrictCreateTypeFieldDefinition: TableScalarColumnDefinition
Overview

The strict field definition is the more structured way to define a field, and follows the following example form:

fields: {
id: { type: 'uuid' },
tags: { type: 'set', valueType: 'text' },
metadata: { type: 'map', keyType: 'text', valueType: 'int' },
}

In this form, the key is the field name, and the value is an object with a type field that specifies the type of the field.

The object may also contain additional fields that are specific to the type of the field:

  • For map, you must specify the keyType and valueType fields.
    • The keyType must, for the time being, be either 'text' or 'ascii'.
    • The valueType must be a scalar type.
  • For lists and sets, you must specify the valueType field.
    • The valueType must be a scalar type.
The "loose" shorthand syntax

If you're simply defining a scalar field, you can use the shorthand "loose" syntax instead, which is equivalent to the above for id:

fields: {
id: 'uuid',
}