JoinedSelectStatement<FirstT extends HasResultSet, FirstD> class Null safety

A SELECT statement that operates on more than one table.

Inheritance
Implemented types
Mixed in types

Constructors

JoinedSelectStatement(DatabaseConnectionUser database, ResultSetImplementation<FirstT, FirstD> table, List<Join<HasResultSet, dynamic>> _joins, [bool distinct = false, bool _includeMainTableInResult = true])
Used internally by drift, users should use SimpleSelectStatement.join instead.

Properties

database DatabaseConnectionUser
The database this statement should be sent to.
@protected, read / write, inherited
distinct bool
Whether to generate a SELECT DISTINCT query that will remove duplicate rows from the result set.
final
hashCode int
The hash code for this object. [...]
read-only, inherited
limitExpr Limit?
The LIMIT clause for this statement.
@protected, read / write, inherited
orderByExpr OrderBy?
The ORDER BY clause for this statement
@protected, read / write, inherited
runtimeType Type
A representation of the runtime type of the object.
read-only, inherited
table ResultSetImplementation<FirstT, FirstD>
The (main) table or view that this query operates on.
read / write, inherited
watchedTables Set<ResultSetImplementation>
The tables this select statement reads from
@Deprecated('Use watchedTables on the generated context'), @visibleForOverriding, read-only
whereExpr Where?
The WHERE clause for this statement
@protected, read / write, inherited

Methods

addColumns(Iterable<Expression> expressions) → void
Adds a custom expression to the query. [...]
constructQuery() GenerationContext
Constructs the query that can then be sent to the database executor. [...]
inherited
get() Future<List<TypedResult>>
Executes this statement and returns the result.
override
getSingle() Future<TypedResult>
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<TypedResult?>
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> expressions, {Expression<bool?>? having}) → void
Groups the result by values in expressions. [...]
join(List<Join<HasResultSet, dynamic>> joins) JoinedSelectStatement<HasResultSet, dynamic>
Adds more joined tables to this JoinedSelectStatement. [...]
limit(int limit, {int? offset}) → void
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(TypedResult)) Selectable<N>
Maps this selectable by the mapper function. [...]
inherited
noSuchMethod(Invocation invocation) → dynamic
Invoked when a non-existent method or property is accessed. [...]
inherited
orderBy(List<OrderingTerm> terms) → void
Orders the results of this statement by the ordering terms.
toString() String
A string representation of this object. [...]
inherited
watch() Stream<List<TypedResult>>
Creates an auto-updating stream of the result that emits new items whenever any table used in this statement changes.
override
watchSingle() Stream<TypedResult>
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<TypedResult?>
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) → void
Applies the predicate as the where clause, which will be used to filter results. [...]
writeInto(GenerationContext context) → void
Writes this component into the context by writing to its GenerationContext.buffer or by introducing bound variables. When writing into the buffer, no whitespace around the this component should be introduced. When a component consists of multiple composed component, it's responsible for introducing whitespace between its child components.
inherited
writeStartPart(GenerationContext ctx) → void
Subclasses must override this and write the part of the statement that comes before the where and limit expression..
override

Operators

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