TableValuedFunction<Self extends ResultSetImplementation> class abstract base

In sqlite3, a table-valued function is a function that resolves to a result set, meaning that it can be selected from.

For more information on table-valued functions in general, visit their documentation on the sqlite website.

This class is meant to be extended for each table-valued function, so that the Self type parameter points to the actual implementation class. The class must also implement createAlias correctly (ensuring that every column has its GeneratedColumn.tableName set to the aliasedName).

For an example of a table-valued function in drift, see the JsonTableFunction in package:drift/json1.dart. It makes the json_each and json_tree table-valued functions available to drift.

Implemented types
Available Extensions
  • @experimental


TableValuedFunction(DatabaseConnectionUser attachedDatabase, {required String functionName, required List<Expression<Object>> arguments, required List<GeneratedColumn<Object>> columns, String? alias})
Constructor for table-valued functions.


$columns List<GeneratedColumn<Object>>
All columns from this table or view.
aliasedName String
The (potentially aliased) name of this table or view.
arguments List<Expression<Object>>
The arguments passed to the table-valued function.
asDslTable → Self
Type system sugar. Implementations are likely to inherit from both TableInfo and Tbl and can thus just return their instance.
no setteroverride
attachedDatabase DatabaseConnectionUser
The generated database instance that this view or table is attached to.
columnsByName Map<String, GeneratedColumn<Object>>
Gets all $columns in this table or view, indexed by their (non-escaped) name.
entityName String
The (unalised) name of this entity in the database.
no setteroverride
hashCode int
The hash code for this object.
no setterinherited
runtimeType Type
A representation of the runtime type of the object.
no setterinherited


createAlias(String alias) ResultSetImplementation<Self, TypedResult>
Creates an alias of this table or view that will write the name alias when used in a query.
map(Map<String, dynamic> data, {String? tablePrefix}) FutureOr<TypedResult>
Maps the given row returned by the database into the fitting data class.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
toString() String
A string representation of this object.
writeInto(GenerationContext context) → void
Writes this component into the context by writing to its GenerationContext.buffer or by introducing bound variables. When writing into the buffer, no whitespace around the this component should be introduced. When a component consists of multiple composed component, it's responsible for introducing whitespace between its child components.


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