$CollectionTable class Null safety

Inheritance
Mixed in types
Available Extensions

Constructors

$CollectionTable(GeneratedDatabase attachedDatabase, [String? _alias])

Properties

$columns List<GeneratedColumn<Object>>
All columns from this table or view.
read-onlyoverride
$primaryKey Set<GeneratedColumn<Object>>
The primary key of this table. Can be empty if no custom primary key has been specified.
read-onlyoverride
actualTableName String
The name of the table in the database. Unlike aliasedName, this can not be aliased.
read-onlyoverride
aliasedName String
The (potentially aliased) name of this table or view.
read-onlyoverride
asDslTable $CollectionTable
Type system sugar. Implementations are likely to inherit from both TableInfo and Tbl and can thus just return their instance.
read-onlyinherited
attachedDatabase GeneratedDatabase
The generated database instance that this view or table is attached to.
final
columnsByName Map<String, GeneratedColumn<Object>>
Gets all $columns in this table, indexed by their (non-escaped) name.
read-onlyinherited
created GeneratedColumn<DateTime>
latefinal
createRule GeneratedColumn<String>
latefinal
customConstraints List<String>
Custom table constraints that should be added to the table.
read-onlyinherited
deleteRule GeneratedColumn<String>
latefinal
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.
read-onlyinherited
entityName String
The (unalised) name of this entity in the database.
read-onlyinherited
extra GeneratedColumn<String>
latefinal
hashCode int
The hash code for this object.
read-onlyinherited
id GeneratedColumn<String>
latefinal
isStrict bool
Whether this table is STRICT.
read-onlyinherited
listRule GeneratedColumn<String>
latefinal
name GeneratedColumn<String>
latefinal
primaryKey Set<Column<Object>>
Override this to specify custom primary keys:
read-onlyinherited
runtimeType Type
A representation of the runtime type of the object.
read-onlyinherited
system GeneratedColumn<bool>
latefinal
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 LocalSettings will be called local_settings by 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.
read-onlyinherited
type GeneratedColumnWithTypeConverter<CollectionType, String>
latefinal
uniqueKeys List<Set<GeneratedColumn<Object>>>
The unique key of this table. Can be empty if no custom primary key has been specified.
read-onlyinherited
updated GeneratedColumn<DateTime>
latefinal
updateRule GeneratedColumn<String>
latefinal
viewRule GeneratedColumn<String>
latefinal
withoutRowId bool
Whether to append a WITHOUT ROWID clause in the CREATE TABLE statement. This is intended to be used by generated code only.
read-onlyinherited

Methods

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
createAlias(String alias) $CollectionTable
Creates an alias of this table or view that will write the name alias when used in a query.
override
dateTime() ColumnBuilder<DateTime>
Use this as the body of a getter to declare a column that holds date and time.
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 enum class T.
inherited
map(Map<String, dynamic> data, {String? tablePrefix}) CollectionData
Maps the given row returned by the database into the fitting data class.
override
mapFromCompanion(Insertable<CollectionData> companion, DatabaseConnectionUser database) Future<CollectionData>
Converts a companion to the real model class, D.
inherited
noSuchMethod(Invocation invocation) → dynamic
Invoked when a non-existent 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 enum class T.
inherited
toString() String
A string representation of this object.
inherited
validateIntegrity(Insertable<CollectionData> instance, {bool isInserting = false}) VerificationContext
Validates that the given entity can be inserted into this table, meaning that it respects all constraints (nullability, text length, etc.).
override

Operators

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

Static Properties

$convertertype JsonTypeConverter2<CollectionType, String, String>
read / write