Composer<Database extends GeneratedDatabase, CurrentTable extends Table> class

A base class for writing computed fields/filters/orderings which have the correct aliases & joins applied

Annotations
  • @immutable

Constructors

Composer.new({required Database $db, required CurrentTable $table, required JoinBuilder? joinBuilder, void $addJoinBuilderToRootComposer(JoinBuilder)?, void $removeJoinBuilderFromRootComposer(JoinBuilder)?})
Base class for all composers

Properties

$addJoinBuilderToRootComposer ↔ void Function(JoinBuilder)
A function to add a join builder to the root composer
latefinal
$db → Database
The database instance used by the composer.
final
$joinBuilder JoinBuilder?
The JoinBuilder used by the composer. If this composer wasn't created by a join, this will be null.
final
$joinBuilders List<JoinBuilder>
If this composer is a root composer, this will contain all the joinBuilders which any children may have created
final
$removeJoinBuilderFromRootComposer ↔ void Function(JoinBuilder)
A function to remove a join builder from the root composer This is used to remove join builders that are no longer needed. e.g.
latefinal
$table → CurrentTable
This current table being managed by the composer without any aliases applies. Use _aliasedTable to get the table with alias.
final
hashCode int
The hash code for this object.
no setterinherited
runtimeType Type
A representation of the runtime type of the object.
no setterinherited

Methods

$composableBuilder<T, C extends GeneratedColumn<Object>>({required C column, required T builder(C column)}) → T
A helper method for creating composables that need the correct aliases for the column and the join builders. Every filter and ordering compasable is created using this method.
$composerBuilder<T, CurrentColumn extends GeneratedColumn<Object>, RelatedTable extends Table, RelatedColumn extends GeneratedColumn<Object>>({required Composer<GeneratedDatabase, Table> composer, required CurrentColumn getCurrentColumn(CurrentTable), required RelatedTable referencedTable, required RelatedColumn getReferencedColumn(RelatedTable), required T builder(JoinBuilder joinBuilder, {void $addJoinBuilderToRootComposer(JoinBuilder)?, void $removeJoinBuilderFromRootComposer(JoinBuilder)?})}) → T
A helper method for creating related composers.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toString() String
A string representation of this object.
inherited

Operators

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