Skip to main content

Types

CSDB values are stored as CSV text and decoded according to the column type.

Implemented Types

The TypeScript runtime currently implements:

TypeRuntime valueSerialized form
textstringUTF-8 text
varcharstringUTF-8 text, with optional length
integernumberBase-10 safe integer
bigintbigintBase-10 integer
realnumberDecimal or scientific notation
numericstringExact decimal text
booleanbooleantrue or false
datestringYYYY-MM-DD
timestampstringISO date-time text
jsonobject, array, primitiveJSON text
customstringText with required type_name metadata

Null Values

All implemented column types accept null when the column is optional and not part of the primary key. Required columns and primary key columns cannot be null.

  • TypeScript row values include null.
  • Unquoted empty CSV fields decode as null for optional, non-primary-key columns.
  • null serializes as an unquoted empty CSV field.
  • Quoted empty strings, written as "", remain empty strings and do not become null.
  • Missing values in inserted rows are filled from defaults when a default exists; otherwise they become null for optional, non-primary-key columns.
  • Explicit null values are preserved and are not replaced by defaults.

SQL can use the NULL literal and IS NULL / IS NOT NULL predicates.

Aliases

AliasCanonical type
character varyingvarchar
int, int4integer
int8bigint
decimalnumeric
boolboolean

Type Objects

Use object form when a type needs options.

columns:
code:
type: varchar
length: 20
amount:
type: numeric
precision: 12
scale: 2
location:
type: custom
type_name: geography_point

Future Registry

The CSDB v1 specification also names future types such as char, smallint, double, time, uuid, binary, jsonb, array, enum, xml, geometric types, network types, range types, any, and engine-specific custom types.