Table class Models

Marks a class as a database table

Annotations
  • @Target.new({TargetKind.classType})

Constructors

Table({String? tableName, bool? omitNull, bool? noPrimaryKey, bool? timestamps = true, bool? paranoid, bool? underscored = false, bool? hasTrigger, bool? freezeTableName, ModelNameOption? name, String? modelName, TimestampOption? createdAt, TimestampOption? deletedAt, TimestampOption? updatedAt, String? schema, String? schemaDelimiter, String? engine, String? charset, String? comment, String? collate, String? initialAutoIncrement, VersionOption? version})
const

Properties

charset String?
The charset to use for the model
final
collate String?
The collation for model's table
final
comment String?
A comment for the table.
final
createdAt TimestampOption?
Override the name of the createdAt attribute if a string is provided, or disable it if false. timestamps must be true.
final
deletedAt TimestampOption?
Override the name of the deletedAt attribute if a string is provided, or disable it if false. timestamps must be true. paranoid must be true.
final
engine String?
The name of the database storage engine to use (e.g. MyISAM, InnoDB).
final
freezeTableName bool?
If true, sequelize will use the name of the Model as-is as the name of the SQL table. If false, the name of the table will be pluralised (and snake_cased if underscored is true).
final
hashCode int
The hash code for this object.
no setterinherited
hasTrigger bool?
Indicates if the model's table has a trigger associated with it.
final
initialAutoIncrement String?
Set the initial AUTO_INCREMENT value for the table in MySQL.
final
modelName String?
The name of the model.
final
name ModelNameOption?
An object with two attributes, singular and plural, which are used when this model is associated to others.
final
noPrimaryKey bool?
Sequelize will automatically add a primary key called id if no primary key has been added manually.
final
omitNull bool?
Don't persist null values. This means that all columns with null values will not be saved.
final
paranoid bool?
If true, calling destroy will not delete the model, but will instead set a deletedAt timestamp.
final
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
schema String?
The database schema in which this table will be located.
final
schemaDelimiter String?
The delimiter used for schema names.
final
tableName String?
The name of the table in SQL.
final
timestamps bool?
Adds createdAt and updatedAt timestamps to the model.
final
underscored bool?
If true, Sequelize will snake_case the name of columns that do not have an explicit value set. The name of the table will also be snake_cased, unless tableName is set, or freezeTableName is true.
final
updatedAt TimestampOption?
Override the name of the updatedAt attribute if a string is provided, or disable it if false. timestamps must be true.
final
version VersionOption?
Enable optimistic locking. When enabled, sequelize will add a version count attribute to the model and throw an OptimisticLockingError error when stale instances are saved.
final

Methods

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

Operators

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