ColumnDefinition class
Declarative column metadata captured by the DSL.
- Annotations
-
- @immutable
Constructors
-
ColumnDefinition({required String name, required ColumnType type, bool unsigned = false, bool nullable = false, bool unique = false, bool indexed = false, bool primaryKey = false, bool autoIncrement = false, ColumnDefault? defaultValue, String? comment, String? charset, String? collation, String? afterColumn, bool first = false, String? generatedAs, String? storedAs, String? virtualAs, bool useCurrentOnUpdate = false, bool invisible = false, bool always = false, List<
String> ? allowedValues, Map<String, ColumnDriverOverride> driverOverrides = const {}}) -
const
-
ColumnDefinition.fromJson(Map<
String, Object?> json) -
factory
Properties
- afterColumn → String?
-
Column name to place this column after when creating the table.
final
-
allowedValues
→ List<
String> ? -
Allowed values for enum-like columns.
final
- always → bool
-
Whether the column always evaluates to a value, even on updates.
final
- autoIncrement → bool
-
Whether the column auto-increments its values.
final
- charset → String?
-
Character set override for the column.
final
- collation → String?
-
Collation override for the column.
final
- comment → String?
-
Comment attached to the column.
final
- defaultValue → ColumnDefault?
-
Default value provided when a column is inserted.
final
-
driverOverrides
→ Map<
String, ColumnDriverOverride> -
Driver-specific overrides keyed by driver name.
final
- first → bool
-
Whether this column is the first column in the table.
final
- generatedAs → String?
-
Generated expression for computed columns.
final
- hashCode → int
-
The hash code for this object.
no setterinherited
- indexed → bool
-
Whether the column should be implicitly indexed.
final
- invisible → bool
-
Whether the column is invisible to queries by default.
final
- name → String
-
Column name as declared in the blueprint.
final
- nullable → bool
-
Whether the column accepts
NULLvalues.final - primaryKey → bool
-
Whether the column is part of the primary key.
final
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- storedAs → String?
-
Storage expression for computed columns.
final
- type → ColumnType
-
Logical column type used during SQL generation.
final
- unique → bool
-
Whether the column enforces a unique constraint.
final
- unsigned → bool
-
Whether the column should be unsigned.
final
- useCurrentOnUpdate → bool
-
Whether to apply
CURRENT_TIMESTAMPwhen the column updates.final - virtualAs → String?
-
Virtual expression for computed columns.
final
Methods
-
copyWith(
{ColumnType? type, bool? unsigned, bool? nullable, bool? unique, bool? indexed, bool? primaryKey, bool? autoIncrement, ColumnDefault? defaultValue, bool clearDefault = false, String? comment, String? charset, String? collation, String? afterColumn, bool? first, String? generatedAs, String? storedAs, String? virtualAs, bool? useCurrentOnUpdate, bool? invisible, bool? always, List< String> ? allowedValues, Map<String, ColumnDriverOverride> ? driverOverrides}) → ColumnDefinition -
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
overrideForDriver(
String driver) → ColumnDriverOverride? -
toJson(
) → Map< String, Object?> -
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited