JoinedSelectStatement<FirstT extends HasResultSet, FirstD> class
A SELECT
statement that operates on more than one table.
- Inheritance
- Implemented types
- Mixed in types
-
- LimitContainerMixin<
FirstT, FirstD> - Selectable<
TypedResult>
- LimitContainerMixin<
Constructors
-
JoinedSelectStatement(DatabaseConnectionUser database, ResultSetImplementation<
FirstT, FirstD> table, List<Join< _joins, [bool distinct = false, bool _includeMainTableInResult = true, bool _includeJoinedTablesInResult = true])HasResultSet, dynamic> > - Used internally by drift, users should use SimpleSelectStatement.join instead.
Properties
- database ↔ DatabaseConnectionUser
-
The database this statement should be sent to.
read / writeinherited
- 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-onlyinherited
- limitExpr ↔ Limit?
-
The
LIMIT
clause for this statement.read / writeinherited - orderByExpr ↔ OrderBy?
-
The
ORDER BY
clause for this statementread / writeinherited - runtimeType → Type
-
A representation of the runtime type of the object.
read-onlyinherited
-
table
↔ ResultSetImplementation<
FirstT, FirstD> -
The (main) table or view that this query operates on.
read / writeinherited
-
watchedTables
→ Set<
ResultSetImplementation> -
The tables this select statement reads from
read-only
- whereExpr ↔ Where?
-
The
WHERE
clause for this statementread / writeinherited - writeReturningClause ↔ bool
-
Whether a
RETURNING *
clause should be added to this statement.read / writeinherited
Methods
-
addColumns(
Iterable< Expression< expressions) → voidObject> > - Adds a custom expression to the query.
-
asyncMap<
N> (Future< N> mapper(TypedResult)) → Selectable<N> -
Maps this selectable by the
mapper
function.inherited -
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<Object> >bool> ? having}) → void -
Groups the result by values in
expressions
. -
join(
List< Join< joins) → JoinedSelectStatement<HasResultSet, dynamic> >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 firstoffset
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 nonexistent 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 aStream<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 aStream<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