BuildColumn<T extends Object> extension
DSL extension to define a column inside a drift table.
- on
Methods
-
check(
Expression< bool> condition) → ColumnBuilder<T> -
Adds a
CHECK
constraint to this column. -
clientDefault(
T onInsert()) → ColumnBuilder< T> - Sets a dynamic default value for this column.
-
customConstraint(
String constraint) → ColumnBuilder< T> - Tells drift to write a custom constraint after this column definition when writing this column, for instance in a CREATE TABLE statement.
-
generatedAs(
Expression< T> generatedAs, {bool stored = false}) → VirtualColumnBuilder<T> - Declare a generated column.
-
references(
Type table, Symbol column, {KeyAction? onUpdate, KeyAction? onDelete}) → ColumnBuilder< T> - Adds a foreign-key reference from this column.
-
withDefault(
Expression< T> e) → ColumnBuilder<T> - The column will use this expression when a row is inserted and no value has been specified.