SimpleSelectStatement<T extends HasResultSet, D> class Null safety

A select statement that doesn't use joins.

For more information, see DatabaseConnectionUser.select.

Inheritance
Implemented types
Mixed in types
Available Extensions

Constructors

SimpleSelectStatement(DatabaseConnectionUser database, ResultSetImplementation<T, D> table, {bool distinct = false})
Used internally by drift, users will want to call DatabaseConnectionUser.select instead.

Properties

database DatabaseConnectionUser
The database this statement should be sent to.
@protected, read / write, inherited
distinct bool
Whether duplicate rows should be eliminated from the result (this is a SELECT DISTINCT statement in sql). Defaults to false.
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<T, D>
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 GenerationContext'), @visibleForOverriding, read-only
whereExpr Where?
The WHERE clause for this statement
@protected, read / write, inherited

Methods

addColumns(List<Expression> expressions) JoinedSelectStatement<HasResultSet, dynamic>
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<D>>
Executes this statement and returns the result.
override
getSingle() Future<D>
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<D?>
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
join(List<Join<HasResultSet, dynamic>> joins) JoinedSelectStatement<HasResultSet, dynamic>
Creates a select statement that operates on more than one table by applying the given joins. [...]
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(D)) 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<OrderClauseGenerator<T>> clauses) → void
Orders the result by the given clauses. The clauses coming first in the list have a higher priority, the later clauses are only considered if the first clause considers two rows to be equal. [...]
toString() String
A string representation of this object. [...]
inherited
watch() Stream<List<D>>
Creates an auto-updating stream of the result that emits new items whenever any table used in this statement changes.
override
watchSingle() Stream<D>
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<D?>
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?> filter(T tbl)) → void
Makes this statement only include rows that match the filter. [...]
inherited
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