// number | null
CqlType2TSType<'int', ...>
// DataAPIDuration | null
CqlType2TSType<{ type: 'duration }, ...>
// Map<string, number>
CqlType2TSType<{ type: 'map', keyType: 'text', valueType: 'int' }>
// unknown
CqlType2TSType<'idk', ...>
// TypeErr<`Invalid definition for 'map'; should be of format { ... }`>
CqlType2TSType<'map'>
| null
As this type is intended primarily for internal usage within the InferTableSchema-like types, it will return <type> | null
for all scalar values, as they all may be null
when returned back from the Data API
You can simply do CqlType2TSType<...> & {}
to get rid of the | null
type (or use type overrides as explained below).
When working with custom ser/des, you may find it necessary to override the type of a specific datatype.
See TableSchemaTypeOverrides for more information on this subject.
// BigNumber | null
CqlType2TSType<'bigint', { bigint: BigNumber | null }>
InferTableSchema
Overview
Converts a CQL type to its TS equivalent.
This interprets both StrictCreateTableColumnDefinition and LooseCreateTableColumnDefinition equally.
vector
types