Interface SetCreateTableColumnDefinition

Overview

Represents the syntax for defining a set column in a table, which has no shorthand/"loose" equivalent.

Of the example format:

columns: {
setCol: { type: 'set', valueType: 'text' },
}

This may then be used through astra-db-ts as n Set<ValueType>:

await table.insertOne({
setCol: new Set(['value1', 'value2', 'value3']),
});
The value type

The valueType may be any scalar type, such as 'int', 'text', or 'uuid'.

Nested collection types are not supported.

Example

import { uuid } from '@datastax/astra-db-ts';

await table.insertOne({
setCol: new Set([uuid(4), uuid(4), uuid(7)]),
});
interface SetCreateTableColumnDefinition {
    type: "set";
    valueType: TableScalarType;
}

Properties

Properties

type: "set"
valueType: TableScalarType