Column class

Describes a column in a database table.

Available extensions

Constructors

Column({required String name, required ColumnType type, bool isPrimaryKey = false, bool isAutoIncrement = false, bool isNullable = false, bool isUnique = false, int length = 255, dynamic defaultValue})
Creates a new Column definition.

Properties

defaultValue → dynamic
The default value for the column, if any.
final
hashCode int
The hash code for this object.
no setterinherited
isAutoIncrement bool
Indicates whether the column is auto-incremented.
final
isNullable bool
Indicates whether the column can be null.
final
isPrimaryKey bool
Indicates whether the column is a primary key.
final
isUnique bool
final
length int
The length of the column (for applicable types like string).
final
name String
The name of the column.
final
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
type ColumnType
The data type of the column.
final

Methods

copyWith({String? name, ColumnType? type, int? length, bool? isPrimaryKey, bool? isAutoIncrement, bool? isNullable, bool? isUnique, dynamic defaultValue}) Column
Returns a new Column with updated values while keeping immutability.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
sqlTypeMySQL() String

Available on Column, provided by the ColumnSQL extension

sqlTypePostgres() String

Available on Column, provided by the ColumnSQL extension

toString() String
A string representation of this object.
inherited

Operators

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