# Columns

<Callout type="info" title="Where this fits">
The [key](/docs/schema/keys-and-identity#keys) 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](/docs/schema/defaults) come after the type.
</Callout>

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](/docs/schema/extensions).

An array is [`.array()`](/docs/schema/enums-arrays-picklists#array) on a scalar. A fixed set of strings on a text column is a [picklist](/docs/schema/enums-arrays-picklists#picklist). A named Postgres enum is its own type, under [enum](/docs/schema/enums-arrays-picklists#enum).

| You store | Builder | Type family |
| --- | --- | --- |
| a string with no length cap | `t.text()` | [Text](/docs/schema/text-columns#text) |
| a string with a maximum length | `t.varchar(n)` | [Text](/docs/schema/text-columns#text) |
| a string compared without case | `t.citext()` | [Text](/docs/schema/text-columns#text) |
| a tight integer | `t.smallint()` | [Integers](/docs/schema/number-columns#integers) |
| a typical count | `t.integer()` | [Integers](/docs/schema/number-columns#integers) |
| a 64-bit integer | `t.bigint()` | [Integers](/docs/schema/number-columns#integers) |
| a generated integer key | `t.integerIdentity()` | [Integers](/docs/schema/number-columns#integers) |
| a generated 64-bit key | `t.identity()` | [Integers](/docs/schema/number-columns#integers) |
| money, a rate, or any exact quantity | `t.numeric(precision, scale)` | [Numbers](/docs/schema/number-columns#numbers) |
| a measurement that may round | `t.double()` | [Floats](/docs/schema/number-columns#floats) |
| an instant | `t.timestamptz()` | [Time](/docs/schema/time-columns#time) |
| a calendar day | `t.date()` | [Time](/docs/schema/time-columns#time) |
| a span | `t.interval()` | [Time](/docs/schema/time-columns#time) |
| true or false | `t.boolean()` | [Boolean and binary](/docs/schema/binary-json-id-columns#boolean-and-binary) |
| bytes | `t.bytea()` | [Boolean and binary](/docs/schema/binary-json-id-columns#boolean-and-binary) |
| a document you query | `t.jsonb()` | [JSON](/docs/schema/binary-json-id-columns#json) |
| a uuid that is not the primary key | `t.uuid()` | [UUID](/docs/schema/binary-json-id-columns#uuid) |
| a primary key the application mints | `t.id({ default: okid() })` | [OKID](/docs/schema/binary-json-id-columns#okid) |
| a closed set of labels | `t.enum(name, values)` | [Named types](/docs/schema/postgres-specific-columns#named-types) |

| Family | You use it for |
| --- | --- |
| [Text](/docs/schema/text-columns) | Text. |
| [Numbers](/docs/schema/number-columns) | Integers, numbers, and floats. |
| [Date and time](/docs/schema/time-columns) | Time. |
| [Binary and JSON](/docs/schema/binary-json-id-columns) | Boolean, bytes, JSON, UUID, and OKID. |
| [Postgres types](/docs/schema/postgres-specific-columns) | Ranges, network, geometry, search, named types, and other Postgres types. |

Index: [/llms.txt](/llms.txt)
