TableManagerState<DB extends GeneratedDatabase, T extends Table, DT extends DataClass, FS extends FilterComposer<DB, T> , OS extends OrderingComposer<DB, T> , C extends ProcessedTableManager<DB, T, DT, FS, OS, C, CI, CU> , CI extends Function, CU extends Function> class
Defines a class that holds the state for a BaseTableManager
It holds the state for manager of T
table in DB
database, used to return DT
data classes/rows.
It holds the FS
Filters and OS
Orderings for the manager.
It also holds the CI
and CU
functions that are used to create companion builders for inserting and updating data.
E.G Instead of CategoriesCompanion.insert(name: "School")
you would use (f) => f(name: "School")
The C
generic refers to the type of the child manager that will be created when a filter/ordering is applied
Constructors
-
TableManagerState({required DB db, required T table, required FS filteringComposer, required OS orderingComposer, required C getChildManagerBuilder(TableManagerState<
DB, T, DT, FS, OS, C, CI, CU> ), required CI getInsertCompanionBuilder, required CU getUpdateCompanionBuilder, Expression<bool> ? filter, bool? distinct, int? limit, int? offset, Set<OrderingBuilder> orderingBuilders = const {}, Set<JoinBuilder> joinBuilders = const {}}) -
Defines a class which holds the state for a table manager
It contains the database instance, the table instance, and any filters/orderings that will be applied to the query
This is held in a seperate class than the BaseTableManager so that the state can be passed down from the root manager to the lower level managers
const
Properties
- db → DB
-
The database that the query will be exeCCted on
final
- distinct → bool?
-
Whether the query should return distinct results
final
-
filter
→ Expression<
bool> ? -
The expression that will be applied to the query
final
- filteringComposer → FS
-
The FilterComposer for this TableManagerState
This class will be used to create filtering Expressions
which will be applied to the statement when its eventually created
final
- hashCode → int
-
The hash code for this object.
no setterinherited
-
joinBuilders
→ Set<
JoinBuilder> -
A set of
JoinBuilder
which will be used to create Joins that will be applied to the build statementfinal - limit → int?
-
If set, the maximum number of rows that will be returned
final
- offset → int?
-
If set, the number of rows that will be skipped
final
-
orderingBuilders
→ Set<
OrderingBuilder> -
A set of
OrderingBuilder
which will be used to apply OrderingTerms to the statement when it's eventually builtfinal - orderingComposer → OS
-
The OrderingComposer for this TableManagerState
This class will be used to create OrderingTerms
which will be applied to the statement when its eventually created
final
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- table → T
-
The table that the query will be exeCCted on
final
Methods
-
buildDeleteStatement(
) → DeleteStatement< Table, dynamic> - Build a delete statement based on the manager state
-
buildSelectStatement(
) → Selectable< DT> - Build a select statement based on the manager state
-
buildUpdateStatement(
) → UpdateStatement< T, DT> - Build an update statement based on the manager state
-
copyWith(
{bool? distinct, int? limit, int? offset, Expression< bool> ? filter, Set<OrderingBuilder> ? orderingBuilders, Set<JoinBuilder> ? joinBuilders}) → TableManagerState<DB, T, DT, FS, OS, C, CI, CU> - Copy this state with the given values
-
count(
) → Future< int> - Count the number of rows that would be returned by the built statement
-
exists(
) → Future< bool> - Check if any rows exists using the built statement
-
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