Type alias StrictCreateTableColumnDefinition

Overview

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

columns: {
uuidCol: { type: 'uuid' },
mapCol: { type: 'map', keyType: 'text', valueType: 'int' },
listCol: { type: 'list', valueType: 'text' },
vectorCol: { type: 'vector', dimension: 3 },
}

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

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

  • 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.
  • For vectors, you must specify the dimension field.
    • You may optionally provide a service field to enable vectorize.
    • Note that you still need to create a vector index on the column to actually use vector search.
The "loose" shorthand syntax

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

columns: {
uuidCol: 'uuid',
}