DbColumn class

Coluna de uma tabela. A "notação do banco" do model: tipo, nulo, único, chave primária e chave estrangeira (references, no formato 'tabela.coluna') para relacionar tabelas.

Constructors

DbColumn(String name, SqlType type, {bool nullable = false, bool unique = false, bool primaryKey = false, bool autoIncrement = false, String? references, String? defaultValue})
const
DbColumn.foreign(String name, String? references, {bool nullable = false})
Chave estrangeira para references (ex.: 'customers.id').
const
DbColumn.id([String name = 'id'])
Coluna id padrão: BIGINT, PK, auto-incremento.
const

Properties

autoIncrement → bool
final
defaultValue → String?
final
hashCode → int
The hash code for this object.
no setterinherited
isForeignKey → bool
no setter
name → String
final
nullable → bool
final
primaryKey → bool
final
references → String?
FK no formato 'tabela.coluna' (ex.: 'customers.id').
final
runtimeType → Type
A representation of the runtime type of the object.
no setterinherited
type → SqlType
final
unique → bool
final

Methods

noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toString() → String
A string representation of this object.
inherited

Operators

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