CustomSelectStatement class

A select statement that is constructed with a raw sql prepared statement instead of the high-level drift api.

Mixed in types

Constructors

CustomSelectStatement(String query, List<Variable<Object>> variables, Set<ResultSetImplementation> tables, DatabaseConnectionUser _db)
Constructs a new custom select statement for the query, the variables, the affected tables and the database.

Properties

hashCode int
The hash code for this object.
no setterinherited
query String
The sql query string for this statement.
final
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
tables Set<ResultSetImplementation>
Tables this select statement reads from. When turning this select query into an auto-updating stream, that stream will emit new items whenever any of these tables changes.
final
variables List<Variable<Object>>
The variables for the prepared statement, in the order they appear in query. Variables are denoted using a question mark in the query.
final

Methods

asyncMap<N>(FutureOr<N> mapper(QueryRow)) Selectable<N>
Maps this selectable by the mapper function.
inherited
get() Future<List<QueryRow>>
Executes this statement and returns the result.
override
getSingle() Future<QueryRow>
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<QueryRow?>
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
map<N>(N mapper(QueryRow)) Selectable<N>
Maps this selectable by the mapper function.
inherited
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toString() String
A string representation of this object.
inherited
watch() Stream<List<QueryRow>>
Creates an auto-updating stream of the result that emits new items whenever any table used in this statement changes.
override
watchSingle() Stream<QueryRow>
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<QueryRow?>
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

Operators

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