Skip to content

Class: Column<TData, TNotNull, THasDefault, TTable>

Class: Column<TData, TNotNull, THasDefault, TTable>

Section titled “Class: Column<TData, TNotNull, THasDefault, TTable>”

Defined in: core/src/schema/columns.ts:66

TData = unknown

TNotNull extends boolean = true

THasDefault extends boolean = false

TTable extends string = string

new Column<TData, TNotNull, THasDefault, TTable>(meta): Column<TData, TNotNull, THasDefault, TTable>

Defined in: core/src/schema/columns.ts:84

ColumnMeta

Column<TData, TNotNull, THasDefault, TTable>

readonly $type: TData

Defined in: core/src/schema/columns.ts:72


readonly $notNull: TNotNull

Defined in: core/src/schema/columns.ts:73


readonly $hasDefault: THasDefault

Defined in: core/src/schema/columns.ts:74


readonly $table: TTable

Defined in: core/src/schema/columns.ts:80

Phantom type carrying the name of the table this column belongs to. Set by table("name", { ... }) when the column is bound. Enables left-join null propagation in projections without a runtime penalty.


readonly meta: ColumnMeta

Defined in: core/src/schema/columns.ts:82

notNull(): Column<TData, true, THasDefault, TTable>

Defined in: core/src/schema/columns.ts:88

Column<TData, true, THasDefault, TTable>


nullable(): Column<TData, false, THasDefault, TTable>

Defined in: core/src/schema/columns.ts:97

Opt this column out of the notNull default. The row shape returned by .select().from(t) gets T | null for this column, and insert().values(...) treats it as optional.

Column<TData, false, THasDefault, TTable>


encrypted(): Column<TData, TNotNull, THasDefault, TTable>

Defined in: core/src/schema/columns.ts:107

Mark this column as end-to-end encrypted. The server stores the envelope at rest; the client’s sync loop encrypts on push and decrypts on pull with the caller-supplied DEK. See Envelope / encryptField in @sh1n4ps/plasma-core and the ROADMAP for key rotation.

Column<TData, TNotNull, THasDefault, TTable>


unique(): Column<TData, TNotNull, THasDefault, TTable>

Defined in: core/src/schema/columns.ts:111

Column<TData, TNotNull, THasDefault, TTable>


default(value): Column<TData, TNotNull, true, TTable>

Defined in: core/src/schema/columns.ts:115

TData

Column<TData, TNotNull, true, TTable>