SelectStatement class final

A select statement referencing multiple tables.

Inheritance

Properties

compounds → List<CompoundSelect>
All CompoundSelect statements that have been added to this select statement using union, unionAll, except and intersect.
finalinherited
dialectSpecificOptions → Map<Symbol, Object?>
A map of dialect-specific options.
finalinherited
distinct → bool
Whether to add a DISTINCT clause to this select, meaning that duplicate rows would be removed.
finalinherited
fromClause → FromClause
The from clause of select statement.
finalinherited
groupByClause ↔ GroupBy?
The optional GROUP BY clause for this select statement.
getter/setter pairinherited
hashCode → int
The hash code for this object.
no setterinherited
limitClause ↔ Limit?
The optional LIMIT clause restricting the amount of rows returned by this statement.
getter/setter pairinherited
orderByClause ↔ OrderBy?
The optional ORDER BY clause for this select statement.
getter/setter pairinherited
runtimeType → Type
A representation of the runtime type of the object.
no setterinherited
structure → ResultSetStructure
The ResultSetStructure for this statement, describing columns we expect it to return.
finalinherited
whereClause ↔ WhereClause?
The filtering WHERE clause of this select statement.
getter/setter pairinherited

Methods

addColumn(Expression<Object> expression) → SelectStatement
Adds a column to this query.
inherited
addColumns(Iterable<Expression<Object>> expressions) → SelectStatement
Adds multiple columns to this query.
inherited
asyncMap<N>(FutureOr<N> mapper(DriftRow)) → Selectable<N>
Maps this selectable by the mapper function.
inherited
compileWith(StatementCompiler compiler) → void
Compiles this component with the given StatementCompiler by invoking the relevant add method on it.
inherited
createMapper(DriftDialect dialect, ResultSetStructure structure) → DriftRow Function(RawRow)
Creates a function that, given a DriftRow, extracts the result set for this BaseSelectStatement.
crossJoin(ResultSetDsl table, {bool? includeInResult}) → SelectStatement
Adds table to this query using a CROSS JOIN operator.
inherited
except(BaseSelectStatement<BaseSelectStatement, dynamic> other) → SelectStatement
Appends the other statement as a EXCEPT clause after this query.
inherited
fullOuterJoin(ResultSetDsl table, {Expression<bool>? on, bool? includeInResult}) → SelectStatement
Adds table to this query using a FULL OUTER JOIN operator.
inherited
get() → Future<List<DriftRow>>
Executes this statement and returns the result.
inherited
getSingle() → Future<DriftRow>
Executes this statement, like Selectable.get, but only returns one value. the query returns no or too many rows, the returned future will complete with an error.
inherited
getSingleOrNull() → Future<DriftRow?>
Executes this statement, like Selectable.get, but only returns one value. If the result too many values, this method will throw. If no row is returned, null will be returned instead.
inherited
groupBy(Iterable<Expression<Object>> expressions, {Expression<bool>? having}) → SelectStatement
Groups the result by values in expressions.
inherited
innerJoin(ResultSetDsl table, {Expression<bool>? on, bool? includeInResult}) → SelectStatement
Adds table to this query using an INNER JOIN operator.
inherited
intersect(BaseSelectStatement<BaseSelectStatement, dynamic> other) → SelectStatement
Appends the other statement as a INTERSECT clause after this query.
inherited
join(Iterable<Join> joins) → SelectStatement
Adds all joins to this select statement.
inherited
leftOuterJoin(ResultSetDsl table, {Expression<bool>? on, bool? includeInResult}) → SelectStatement
Adds table to this query using a LEFT OUTER JOIN operator.
inherited
limit(int limit, {int? offset}) → SelectStatement
Limits the amount of rows returned by capping them at limit. If offset is provided as well, the first offset rows will be skipped and not included in the result.
inherited
map<N>(N mapper(DriftRow)) → Selectable<N>
Maps this selectable by the mapper function.
inherited
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
orderBy(List<OrderingTerm> terms) → SelectStatement
Orders the results of this statement by the ordering terms.
rightOuterJoin(ResultSetDsl table, {Expression<bool>? on, bool? includeInResult}) → SelectStatement
Adds table to this query using a RIGHT OUTER JOIN operator.
inherited
toString() → String
A string representation of this object.
inherited
union(BaseSelectStatement<BaseSelectStatement, dynamic> other) → SelectStatement
Appends the other statement as a UNION clause after this query.
inherited
unionAll(BaseSelectStatement<BaseSelectStatement, dynamic> other) → SelectStatement
Appends the other statement as a UNION ALL clause after this query.
inherited
watch() → QueryStream<List<DriftRow>>
Creates an auto-updating stream of the result that emits new items whenever any table used in this statement changes.
inherited
watchSingle() → Stream<DriftRow>
Creates an auto-updating stream of this statement, similar to Selectable.watch. However, it is assumed that the query will only emit one result, so instead of returning a Stream<List<T>>, this returns a Stream<T>. If, at any point, the query emits no or more than one rows, an error will be added to the stream instead.
inherited
watchSingleOrNull() → Stream<DriftRow?>
Creates an auto-updating stream of this statement, similar to Selectable.watch. However, it is assumed that the query will only emit one result, so instead of returning a Stream<List<T>>, this returns a Stream<T?>. If the query emits more than one row at some point, an error will be emitted to the stream instead. If the query emits zero rows at some point, null will be added to the stream instead.
inherited
where(Expression<bool> predicate) → SelectStatement
Applies the predicate as the where clause, which will be used to filter results.

Operators

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