The common superclass for table classes generated by drift_dev.
- Inheritance
-
- Object
- ResultSetDsl
- Table
- GeneratedTable
- Implemented types
-
- ResultSet<
Row, Self> - SchemaEntityWithResultSet<
Row, Self>
- ResultSet<
- Available extensions
Properties
- alias → String?
-
When created through withAlias, an alias for this result set.
no setterinherited
- aliasOrName → String
-
If an alias is set, the alias. Otherwise, the entityName for this
result set.
no setterinherited
-
columns
→ List<
TableColumn< Object> > -
The columns of this result set.
no setteroverride
-
columnsByName
→ Map<
String, SchemaColumn< Object> > -
All columns, indexed by their name.
latefinalinherited
-
constraints
→ List<
TableConstraint> -
Available on GeneratedTable<
All table constraints that have been added to this table.Object, GeneratedTable< , provided by the GeneratedTableExtension extensionObject, dynamic> >no setter -
customConstraints
→ List<
String> -
Custom table constraints that should be added to the table.
no setterinherited
- dontWriteConstraints → bool
-
Drift will write some table constraints automatically, for instance when
you override primaryKey. You can turn this behavior off if you want to.
This is intended to be used by generated code only.
no setterinherited
- entityName → String
-
The default name of this result set (if no alias is set).
no setterinherited
- hashCode → int
-
The hash code for this object.
no setterinherited
- isStrict → bool
-
Whether this table is
STRICT.no setterinherited -
primaryKey
→ Set<
Column< ?Object> > -
Override this to specify custom primary keys:
no setterinherited
-
resolvedPrimaryKey
→ Set<
TableColumn< Object> > -
Available on GeneratedTable<
The resolved primary key of this table.Object, GeneratedTable< , provided by the GeneratedTableExtension extensionObject, dynamic> >no setter - runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- tableName → String?
-
The sql table name to be used. By default, drift will use the snake_case
representation of your class name as the sql table name. For instance, a
Table class named
LocalSettingswill be calledlocal_settingsby default. You can change that behavior by overriding this method to use a custom name. Please note that you must directly return a string literal by using a getter. For instance@override String get tableName => 'my_table';is valid, whereas@override final String tableName = 'my_table';or@override String get tableName => createMyTableName();is not.no setterinherited -
uniqueKeys
→ List<
Set< ?Column< >Object> > -
Unique constraints in this table.
no setterinherited
- withoutRowId → bool
-
Whether to append a
WITHOUT ROWIDclause in theCREATE TABLEstatement. This is intended to be used by generated code only.no setterinherited
Methods
-
asSelfType(
) → Self -
Type-level hack: Result sets are supposed to inherit from the
Selftype they declare, so this returns justthis.inherited -
blob(
) → ColumnBuilder< Uint8List> -
Use this as the body of a getter to declare a column that holds arbitrary
data blobs, stored as an Uint8List. Example:
inherited
-
boolean(
) → ColumnBuilder< bool> -
Use this as the body of a getter to declare a column that holds bools.
Example (inside the body of a table class):
inherited
-
col<
T extends Object> (SqlType< T> type) → ColumnBuilder<T> -
Defines a column with a non-standard SQL
type.inherited -
createMapperFromPositions(
DriftDialect dialect, List< ColumnPosition> positions) → Row? Function(RawRow) -
Like createMapperToDart, but with positions already resolved.
inherited
-
createMapperToDart(
DriftDialect dialect, ResultSetStructure structure) → Row? Function(RawRow) -
Creates a function that, when receiving a DriftRow, extracts columns for
this result set into the mapped
Rowtype.inherited -
customType<
T extends Object> (SqlType< T> type) → ColumnBuilder<T> -
Defines a column with a custom
typewhen used as a getter.inherited -
dateTime(
) → ColumnBuilder< DateTime> -
Use this as the body of a getter to declare a column that holds date and
time values.
inherited
-
int64(
) → ColumnBuilder< BigInt> -
Use this as the body of a getter to declare a column that holds a 64-big
integer as a BigInt.
inherited
-
integer(
) → ColumnBuilder< int> -
Use this as the body of a getter to declare a column that holds integers.
inherited
-
intEnum<
T extends Enum> () → ColumnBuilder< int> -
Creates a column to store an
enumclassT.inherited -
json(
) → ColumnBuilder< DatabaseJson> -
Use this as the body of a getter to declare a column that holds strings.
Example (inside the body of a table class):
inherited
-
mapFromCompanion(
Insertable< Row> companion, DriftDialect dialect) → Row -
Converts a
companionto the real model class,Row.inherited -
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
real(
) → ColumnBuilder< double> -
Use this as the body of a getter to declare a column that holds floating
point numbers. Example
inherited
-
text(
) → ColumnBuilder< String> -
Use this as the body of a getter to declare a column that holds strings.
Example (inside the body of a table class):
inherited
-
textEnum<
T extends Enum> () → ColumnBuilder< String> -
Creates a column to store an
enumclassT.inherited -
toString(
) → String -
A string representation of this object.
inherited
-
withAlias(
String alias) → Self -
Returns a new instance of this result set with
aliasset to the given value.inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited