ColumnDefinition class

One column in a Blueprint, with its fluent modifiers.

Implementers

Constructors

ColumnDefinition(String name, ColumnType type, {int? length, int? precision, int? scale})

Properties

defaultVal Object?
getter/setter pair
hasDefault bool
getter/setter pair
hashCode int
The hash code for this object.
no setterinherited
isIndex bool
getter/setter pair
isNullable bool
getter/setter pair
isPrimary bool
getter/setter pair
isUnique bool
getter/setter pair
isUnsigned bool
getter/setter pair
isUseCurrent bool
getter/setter pair
length int?
string length; decimal precision/scale.
final
name String
final
precision int?
final
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
scale int?
final
type ColumnType
final

Methods

defaultValue(Object? value) ColumnDefinition
A literal default. Accepts bool, num, String, RawSql or null; anything else throws ArgumentError.
index() ColumnDefinition
Adds an index on this column.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
nullable([bool value = true]) ColumnDefinition
Allows NULL (nullable(false) makes the column NOT NULL again).
primary() ColumnDefinition
Makes this column the primary key (use Blueprint.id for the usual auto-increment key).
toString() String
A string representation of this object.
inherited
unique() ColumnDefinition
Adds a unique index on this column.
unsigned() ColumnDefinition
Marks the column unsigned. Neither SQLite nor PostgreSQL has unsigned integers, so the grammars record it but emit nothing.
useCurrent() ColumnDefinition
Defaults the column to current_timestamp.

Operators

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