Skip to content

Column<T, I, O, D> = ColumnProperties<T, I, O, D> & T extends IndexableTypeTag ? IndexableColumn<T, O, D> : unknown

Defined in: src/schema/column.ts:40

A column: the declaration of one attribute in a schema — its type, whether the node indexes it, whether an entity may leave it unset, and the value the SDK writes when a create leaves it out.

Built by calling a type constructor with no arguments — str(), dec(), bytes() — and refined by chaining. Every refinement returns a new column; a column is never modified in place.

T extends TypeTag = TypeTag

The attribute’s type tag.

I extends boolean = boolean

Whether the attribute is indexed.

O extends boolean = boolean

Whether the attribute may be absent.

D extends boolean = boolean

Whether the column has a default.

str() // stored, not indexed, required
str().indexed() // filterable with eq / ne / startsWith
dec().indexed().optional() // filterable, and an entity may leave it unset
str().default("text/markdown") // filled in on create when left out
bytes() // a blob; bytes has no .indexed()