AbstractAlias for $onUpdateFn.
ProtectedconfigStatic Readonly[entityAdds a dynamic default value to the column. The function will be called when the row is inserted, and the returned value will be used as the column value.
Note: This value does not affect the drizzle-kit behavior, it is only used at runtime in drizzle-orm.
Adds a dynamic update value to the column.
The function will be called when the row is updated, and the returned value will be used as the column value if none is provided.
If no default (or $defaultFn) value is provided, the function will be called when the row is inserted as well, and the returned value will be used as the column value.
Note: This value does not affect the drizzle-kit behavior, it is only used at runtime in drizzle-orm.
Changes the data type of the column. Commonly used with json columns. Also, useful for branded types.
Adds a default <value> clause to the column definition.
Affects the insert model of the table - columns with default are optional on insert.
If you need to set a dynamic default value, use $defaultFn instead.
Optionalconfig: SQLiteGeneratedColumnConfigAdds a not null clause to the column definition.
Affects the select model of the table - columns without not null will be nullable on select.
Adds a primary key clause to the column definition. This implicitly makes the column not null.
In SQLite, integer primary key implicitly makes the column auto-incrementing.
Optionalconfig: PrimaryKeyConfigOptionalactions: { onDelete?: UpdateDeleteAction; onUpdate?: UpdateDeleteAction }Optionalname: string
Alias for $defaultFn.