Composer<Database extends GeneratedDatabase, CurrentTable extends Table> constructor
Composer<Database extends GeneratedDatabase, CurrentTable extends Table> ({
- required Database $db,
- required CurrentTable $table,
- required JoinBuilder? joinBuilder,
- void $addJoinBuilderToRootComposer()?,
- void $removeJoinBuilderFromRootComposer()?,
Base class for all composers
A composer can create child composers which can create more child composers. When a child composer is created, a join builder is created and added to the root composer.
When the composer is finished, the $joinBuilders list will contain all the join builders that are needed to create the query.
Implementation
Composer({
required this.$db,
required this.$table,
required JoinBuilder? joinBuilder,
void Function(JoinBuilder)? $addJoinBuilderToRootComposer,
void Function(JoinBuilder)? $removeJoinBuilderFromRootComposer,
}) : $joinBuilder = joinBuilder {
this.$addJoinBuilderToRootComposer = $addJoinBuilderToRootComposer ??
((JoinBuilder joinBuilder) => $joinBuilders.add(joinBuilder));
this.$removeJoinBuilderFromRootComposer =
$removeJoinBuilderFromRootComposer ??
((JoinBuilder joinBuilder) => $joinBuilders.remove(joinBuilder));
}