VirtualTableInfo<TableDsl extends Table, D> mixin

Additional interface for tables in a drift file that have been created with an CREATE VIRTUAL TABLE STATEMENT.

Superclass constraints
Mixin applications
Available extensions

Properties

$columns List<GeneratedColumn<Object>>
All columns from this table or view.
no setterinherited
$primaryKey Set<GeneratedColumn<Object>>
The primary key of this table. Can be empty if no custom primary key has been specified.
no setterinherited
actualTableName String
The name of the table in the database. Unlike aliasedName, this can not be aliased.
no setterinherited
aliasedName String
The (potentially aliased) name of this table or view.
no setterinherited
asDslTable → TableDsl
Type system sugar. Implementations are likely to inherit from both TableInfo and Tbl and can thus just return their instance.
no setterinherited
columnsByName Map<String, GeneratedColumn<Object>>
Gets all $columns in this table or view, indexed by their (non-escaped) name.
no setterinherited
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 (unalised) name of this entity in the database.
no setterinherited
hashCode int
The hash code for this object.
no setterinherited
isStrict bool
Whether this table is STRICT.
no setterinherited
moduleAndArgs String
Returns the module name and the arguments that were used in the statement that created this table. In that sense, CREATE VIRTUAL TABLE <name> USING <moduleAndArgs>; can be used to create this table in sql.
no setter
primaryKey Set<Column<Object>>
Override this to specify custom primary keys:
no setterinherited
rank Expression<double>

Available on VirtualTableInfo<Table, dynamic>, provided by the Fts5Extensions extension

The relevance of a match found by an fts5 query, as computed by bm25 with default weights.
no setter
rowId Expression<int>

Available on TableInfo<Table, dynamic>, provided by the RowIdExtension extension

In sqlite, each table that hasn't been created with the WITHOUT ROWID modifier has a row id. When the table has a single primary key column which is an integer, that column is an alias to the row id in sqlite3.
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 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.
no setterinherited
uniqueKeys List<Set<GeneratedColumn<Object>>>
The unique key of this table. Can be empty if no custom primary key has been specified.
no setterinherited
withoutRowId bool
Whether to append a WITHOUT ROWID clause in the CREATE TABLE statement. This is intended to be used by generated code only.
no setterinherited

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
bm25({List<double> weights = const []}) Expression<double>

Available on VirtualTableInfo<Table, dynamic>, provided by the Fts5Extensions extension

The bm25 relevance of a match found by an fts5 query.
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) TableInfo<TableDsl, D>
Creates an alias of this table or view that will write the name alias when used in a query.
inherited
customType<T extends Object>(UserDefinedSqlType<T> type) ColumnBuilder<T>
Defines a column with a custom type when 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
delete() DeleteStatement<Tbl, Row>

Available on TableInfo<Tbl, Row>, provided by the TableStatements extension

Creates a statement to compose a DELETE from the database.
deleteAll() Future<int>

Available on TableInfo<Tbl, Row>, provided by the TableStatements extension

Deletes ALL rows from the table.
deleteOne(Insertable<Row> row) Future<bool>

Available on TableInfo<Tbl, Row>, provided by the TableStatements extension

Deletes the row from the captured table.
deleteWhere(Expression<bool> filter(Tbl tbl)) Future<int>

Available on TableInfo<Tbl, Row>, provided by the TableStatements extension

Deletes all rows matching the filter from the table.
highlight(GeneratedColumn<String> column, {required String before, required String after}) Expression<String>

Available on VirtualTableInfo<Table, dynamic>, provided by the Fts5Extensions extension

Returns the text of column with a match found by an fts5 query wrapped in before and after.
insert() InsertStatement<Tbl, Row>

Available on TableInfo<Tbl, Row>, provided by the TableStatements extension

Creates an insert statment to be used to compose an insert on the table.
insertAll(Iterable<Insertable<Row>> rows, {InsertMode? mode, UpsertClause<Tbl, Row>? onConflict}) Future<void>

Available on TableInfo<Tbl, Row>, provided by the TableStatements extension

Atomically inserts all rows into the table.
insertOnConflictUpdate(Insertable<Row> row) Future<int>

Available on TableInfo<Tbl, Row>, provided by the TableStatements extension

Inserts one row into this table table, replacing an existing row if it exists already.
insertOne(Insertable<Row> row, {InsertMode? mode, UpsertClause<Tbl, Row>? onConflict}) Future<int>

Available on TableInfo<Tbl, Row>, provided by the TableStatements extension

Inserts one row into this table.
insertReturning(Insertable<Row> row, {InsertMode? mode, UpsertClause<Tbl, Row>? onConflict}) Future<Row>

Available on TableInfo<Tbl, Row>, provided by the TableStatements extension

Inserts one row into this table and returns it, along with auto-generated fields.
insertReturningOrNull(Insertable<Row> row, {InsertMode? mode, UpsertClause<Tbl, Row>? onConflict}) Future<Row?>

Available on TableInfo<Tbl, Row>, provided by the TableStatements extension

Inserts one row into this table and returns it, along with auto-generated fields.
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}) FutureOr<D>
Maps the given row returned by the database into the fitting data class.
inherited
mapFromCompanion(Insertable<D> companion, DatabaseConnectionUser database) Future<D>
Converts a companion to the real model class, D.
inherited
match(String query) Expression<bool>

Available on VirtualTableInfo<Table, dynamic>, provided by the Fts5Extensions extension

Whether this table contains a row matching the fts5 query string.
matchExp(Expression<String> expression) Expression<bool>

Available on VirtualTableInfo<Table, dynamic>, provided by the Fts5Extensions extension

Whether this table contains a row matching the fts5 query given as an sql expression.
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
replaceOne(Insertable<Row> row) Future<void>

Available on TableInfo<Tbl, Row>, provided by the TableStatements extension

Replaces a single row with an update statement.
snippet(GeneratedColumn<String> column, {required String before, required String after, required String ellipsis, required int tokenCount}) Expression<String>

Available on VirtualTableInfo<Table, dynamic>, provided by the Fts5Extensions extension

Like highlight, but only reports a tokenCount tokens of text around each match, separated by ellipsis when text was omitted.
sqliteAny() ColumnBuilder<DriftAny>
Use this as a the body of a getter to declare a column that holds arbitrary values not modified by drift at runtime.
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
update() UpdateStatement<Tbl, Row>

Available on TableInfo<Tbl, Row>, provided by the TableStatements extension

Creates a statement to compose an UPDATE into the database.
validateIntegrity(Insertable<D> 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.).
inherited

Operators

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