ColumnDef class

A single column definition.

Constructors

ColumnDef(String name, DataType type, {bool primaryKey = false, bool notNull = false, bool unique = false, bool autoIncrement = false, Object? defaultValue, String? defaultExprSql, String? checkExprSql, ForeignKeyRef? references, String? generatedExprSql, bool generatedStored = false, Map<String, String>? vectorSpec})
const
ColumnDef.fromJson(Map<String, Object?> j)
factory

Properties

autoIncrement bool
final
checkExprSql String?
CHECK expression source text (column-level). The DB engine re-parses this on demand. Stored as text so it survives JSON serialization.
final
defaultExprSql String?
DEFAULT (<expr>) source text (column-level). Mutually optional with defaultValue; when both are present defaultValue wins as the cheap fast-path for plain literals.
final
defaultValue Object?
final
generatedExprSql String?
GENERATED ALWAYS AS (<expr>) [VIRTUAL|STORED] source. When set, the column's value is computed from this expression at INSERT/UPDATE time.
final
generatedStored bool
final
hashCode int
The hash code for this object.
no setterinherited
name String
final
notNull bool
final
primaryKey bool
final
references ForeignKeyRef?
FOREIGN KEY target ("table" or "table(column)") for column-level FK.
final
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
type DataType
final
unique bool
final
vectorSpec Map<String, String>?
V30: VECTOR(dim=384, kind=hnsw, metric=cosine, ...) inline spec. Consumed by CREATE TABLE to auto-register a vector index on this column. Map keys are lowercased attribute names.
final

Methods

noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toJson() Map<String, Object?>
toString() String
A string representation of this object.
inherited

Operators

operator ==(Object other) bool
The equality operator.
inherited