Schema

Columns

Each field is a data type. The builder name is that type.

Where this fits

The key is one column. Each other field is a builder on its type family page. Use the table first, then the section for that storage. Defaults come after the type.

Each field is a data type. The builder name is that type. Postgres is the only database today. A cell is yes when that database has the type built in, and extension when the schema must list that extension. Another database is another column on the same row. A missing extension declaration is OKM1020. See extensions.

An array is .array() on a scalar. A fixed set of strings on a text column is a picklist. A named Postgres enum is its own type, under enum.

You storeBuilderType family
a string with no length capt.text()Text
a string with a maximum lengtht.varchar(n)Text
a string compared without caset.citext()Text
a tight integert.smallint()Integers
a typical countt.integer()Integers
a 64-bit integert.bigint()Integers
a generated integer keyt.integerIdentity()Integers
a generated 64-bit keyt.identity()Integers
money, a rate, or any exact quantityt.numeric(precision, scale)Numbers
a measurement that may roundt.double()Floats
an instantt.timestamptz()Time
a calendar dayt.date()Time
a spant.interval()Time
true or falset.boolean()Boolean and binary
bytest.bytea()Boolean and binary
a document you queryt.jsonb()JSON
a uuid that is not the primary keyt.uuid()UUID
a primary key the application mintst.id({ default: okid() })OKID
a closed set of labelst.enum(name, values)Named types
FamilyYou use it for
TextText.
NumbersIntegers, numbers, and floats.
Date and timeTime.
Binary and JSONBoolean, bytes, JSON, UUID, and OKID.
Postgres typesRanges, network, geometry, search, named types, and other Postgres types.