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.
- Inheritance
-
- Object
- DatabaseSchemaEntity
- ResultSetImplementation<
Self, TypedResult> - TableValuedFunction
- Implemented types
- Implementers
- Annotations
-
- @experimental
Constructors
-
TableValuedFunction(DatabaseConnectionUser attachedDatabase, {required String functionName, required List<
Expression< arguments, required List<Object> >GeneratedColumn< columns, String? alias})Object> > - Constructor for table-valued functions.
Properties
-
$columns
→ List<
GeneratedColumn< Object> > -
All columns from this table or view.
final
- aliasedName → String
-
The (potentially aliased) name of this table or view.
final
-
arguments
→ List<
Expression< Object> > -
The arguments passed to the table-valued function.
final
- 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.
final
-
columnsByName
→ Map<
String, GeneratedColumn< Object> > -
Gets all $columns in this table or view, indexed by their (non-escaped)
name.
latefinal
- 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
Methods
-
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.inherited -
map(
Map< String, dynamic> data, {String? tablePrefix}) → FutureOr<TypedResult> -
Maps the given row returned by the database into the fitting data class.
override
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
toString(
) → String -
A string representation of this object.
inherited
-
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.override
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited