TableSet<R, F extends Fields> class
Typed access to a table, including full-row reads and prepared inserts.
- Inheritance
- Available extensions
Constructors
-
TableSet(QueryContext database, Table<
R, F> definition) - Binds a table definition to a compilation or execution context.
Properties
- database → QueryContext
-
The compilation or execution context that owns this query.
finalinherited
-
definition
→ Table<
R, F> -
The table definition used to create fields and decode full rows.
final
-
dependencies
→ ({bool opaque, Set<
TableSchema> tables}) -
Physical read dependencies used by subscriptions, including relation batches.
no setterinherited
- hashCode → int
-
The hash code for this object.
no setterinherited
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
Methods
-
asCte(
String name) → Cte< R, F> -
Names this query as a CTE for further typed composition.
inherited
-
bind(
QueryContext context) → Query< R, F> -
Rebind the root description to an execution context. Nested queries retain
their original context and are rejected when they do not match.
inherited
-
compile(
) → SqlCommand -
Validates and compiles SQL with separately bound parameters, without I/O.
inherited
-
count(
{ExecutionOptions options = const ExecutionOptions()}) → Future< int> -
Counts the query's result rows, including its limit, offset and grouping.
inherited
-
createRow(
List< Assignment> assignments(F), {ExecutionOptions options = const ExecutionOptions()}) → Future<R> - Inserts and returns a complete row.
-
cursorToken(
List< CursorTerm> cursor(F)) → String -
Available on Query<
Versioned, lossless cursor transport. This is pagination input, not an authorization token. The next query still applies its own WHERE policies.R, F> , provided by the KeysetQuery extension -
delete(
) → Mutation< F> -
Prepares a delete; no SQL runs until the mutation is executed.
inherited
-
distinct(
) → Query< R, F> -
Removes duplicate SQL projections before any Dart mapping.
inherited
-
exists(
{ExecutionOptions options = const ExecutionOptions()}) → Future< bool> -
Checks whether the current query yields at least one row.
inherited
-
existsExpression(
) → Expr< bool> -
Builds a SQL EXISTS expression without executing a read.
inherited
-
first(
{ExecutionOptions options = const ExecutionOptions()}) → Future< R> -
Returns the first selected row, or throws
QUERY.CARDINALITYif empty.inherited -
firstOrNull(
{ExecutionOptions options = const ExecutionOptions()}) → Future< R?> -
Returns the first selected row, or null when the query is empty.
inherited
-
get(
{ExecutionOptions options = const ExecutionOptions()}) → Future< List< R> > -
Executes the query and decodes all selected rows.
inherited
-
groupBy(
List< Expr< group(F)) → Query<Object?> >R, F> -
Replaces SQL grouping expressions; selected non-aggregates must be grouped.
inherited
-
having(
Expr< bool?> condition(F)) → Query<R, F> -
Adds an aggregate filter with AND to the existing HAVING clause.
inherited
-
insert(
List< Assignment> assignments(F)) → Mutation<F> - Prepares one insert, evaluating omitted client defaults once now.
-
insertMany<
T> (Iterable< T> rows, List<Assignment> values(F, T)) → BatchInsert<F> - Prepares rows for a parameter-aware batch insert.
-
inspect(
) → QueryPlan -
Inspects SQL and conditional relation batches without acquiring a connection.
This does not ask the database optimizer for an execution plan.
inherited
-
join<
S, G extends Fields> (TableAlias< S, G> alias, {required Expr<bool?> on(F, G)}) → Query<R, F> -
Adds an inner join using an independently created table alias.
inherited
-
leftJoin<
S, G extends Fields> (TableAlias< S, G> alias, {required Expr<bool?> on(F, G)}) → Query<R, F> -
Adds a left join; use the alias's optional selection for absent rows.
inherited
-
map<
S> (S mapper(R)) → Query< S, F> -
Maps decoded rows in Dart. This does not create SQL columns or change
database DISTINCT/UNION semantics; compose SQL set operations first.
inherited
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
orderBy(
List< OrderTerm> order(F)) → Query<R, F> -
Replaces the query's ordering with the supplied expressions.
inherited
-
scalar(
) → Expr< R?> -
Converts a scalar selection into a nullable SQL subquery.
inherited
-
seekAfter(
List< CursorTerm> cursor(F)) → Query<R, F> -
Available on Query<
Adds a lexicographic boundary afterR, F> , provided by the KeysetQuery extensioncursorand replaces query ordering. -
seekToken(
String token, {required List< OrderTerm> orderBy(F)}) → Query<R, F> -
Available on Query<
Restores a cursorToken using the expected table and complete sort order.R, F> , provided by the KeysetQuery extension -
select<
S> (Selection< S> selection(F)) → Query<S, F> -
Chooses the SQL columns and result type to decode.
inherited
-
single(
{ExecutionOptions options = const ExecutionOptions()}) → Future< R> -
Returns exactly one selected row or throws
QUERY.CARDINALITY.inherited -
singleOrNull(
{ExecutionOptions options = const ExecutionOptions()}) → Future< R?> -
Returns the only selected row, or null when empty.
inherited
-
skip(
int count) → Query< R, F> -
Replaces the row offset; count must be nonnegative.
inherited
-
stream(
{int batchSize = 128, ExecutionOptions options = const ExecutionOptions()}) → Stream< R> -
Available on Query<
One database cursor, fetched on demand. Related rows are loaded per root batch on the same connection. Pause/await-for consumption provides demand.R, F> , provided by the QueryStreaming extension -
take(
int count) → Query< R, F> -
Replaces the row limit; count must be nonnegative.
inherited
-
toString(
) → String -
A string representation of this object.
inherited
-
union<
G extends Fields> (Query< R, G> other) → Query<R, UnionFields< F> > -
Available on Query<
Combines SQL scalars orR, F> , provided by the SetQueries extension.rowprojections. Both operands must use this database/session and the same codecs, column types and nullability. -
unionAll<
G extends Fields> (Query< R, G> other) → Query<R, UnionFields< F> > -
Available on Query<
Keeps duplicate SQL rows. Row order requires an explicit final orderBy.R, F> , provided by the SetQueries extension -
update(
List< Assignment> assignments(F)) → Mutation<F> -
Prepares an update; call the mutation's execute or returning method.
inherited
-
watch(
{Iterable< TableSchema> reads = const [], ExecutionOptions options = const ExecutionOptions()}) → Stream<List< R> > -
Available on Query<
Initial snapshot followed by fresh snapshots after relevant committed writes. Add tables hidden inside raw SQL withR, F> , provided by the WatchQuery extensionreads. Read errors are emitted without closing the stream, allowing a later invalidation to retry the query. -
where(
Expr< bool?> condition(F)) → Query<R, F> -
Adds a predicate with AND, preserving any existing filter.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited