Query<T, Where extends QueryWhere> class abstract

A SQL SELECT query builder.

Inheritance

Constructors

Query({Query<dynamic, QueryWhere>? parent})

Properties

aliases Map<String, String>
AS aliases to inject into the query, if any.
getter/setter pairinherited
casts Map<String, String>
Casts to perform when querying the database.
no setterinherited
expressions Map<String, String>
A map of field names to explicit SQL expressions. The expressions will be aliased to the given names.
final
fields List<String>
The list of fields returned by this query.
no setterinherited
fieldSet String
A String of all fields, joined by a comma (,).
no setterinherited
hashCode int
The hash code for this object.
no setterinherited
parent Query<dynamic, QueryWhere>?
final
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
substitutionValues Map<String, dynamic>
Values to insert into a prepared statement.
no setteroverride
tableName String
The table against which to execute this query.
no setterinherited
values QueryValues?
A set of values, for an insertion or update.
no setter
where → Where?
A reference to an abstract query builder.
no setter

Methods

adornWithTableName(String s) String
Preprends the tableName to the String, s.
andWhere(void f(Where)) → void
Shorthand for calling where.or with a Where clause.
canCompile(Set<String> trampoline) bool
Determines whether this query can be compiled.
compile(Set<String> trampoline, {bool includeTableName = false, String? preamble, bool withFields = true, String? fromQuery}) String
override
crossJoin(String tableName) → void
Execute a CROSS JOIN (Cartesian product) against another table.
delete(QueryExecutor executor) Future<List<T>>
deleteOne(QueryExecutor executor) Future<Optional<T>>
deserialize(List row) → Optional<T>
inherited
deserializeList(List<List> it) List<T>
inherited
fullOuterJoin(dynamic tableName, String localKey, String foreignKey, {String op = '=', List<String> additionalFields = const [], Set<String>? trampoline, String? alias}) → void
Execute a FULL OUTER JOIN against another table.
get(QueryExecutor executor) Future<List<T>>
inherited
getOne(QueryExecutor executor) Future<Optional<T>>
override
groupBy(String key) → void
Groups the results by a given key.
insert(QueryExecutor executor) Future<Optional<T>>
join(dynamic tableName, String localKey, String foreignKey, {String op = '=', List<String> additionalFields = const [], Set<String>? trampoline, String? alias}) → void
Execute an INNER JOIN against another table.
leftJoin(dynamic tableName, String localKey, String foreignKey, {String op = '=', List<String> additionalFields = const [], Set<String>? trampoline, String? alias}) → void
Execute a LEFT JOIN against another table.
limit(int n) → void
Limit the number of rows to return.
newWhereClause() → Where
Makes a Where clause.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
notWhere(void f(Where)) → void
Shorthand for calling where.or with a Where clause.
offset(int n) → void
Skip a number of rows in the query.
orderBy(String key, {bool descending = false}) → void
Sorts the results by a key.
orWhere(void f(Where)) → void
Shorthand for calling where.or with a Where clause.
reserveName(String name) String
Returns a unique version of name, which will not produce a collision within the context of this query.
rightJoin(dynamic tableName, String localKey, String foreignKey, {String op = '=', List<String> additionalFields = const [], Set<String>? trampoline, String? alias}) → void
Execute a RIGHT JOIN against another table.
selfJoin(dynamic tableName, String localKey, String foreignKey, {String op = '=', List<String> additionalFields = const [], Set<String>? trampoline, String? alias}) → void
Execute a SELF JOIN.
toString() String
A string representation of this object.
inherited
union(QueryBase<T> other) Union<T>
inherited
unionAll(QueryBase<T> other) Union<T>
inherited
update(QueryExecutor executor) Future<List<T>>
updateOne(QueryExecutor executor) Future<Optional<T>>

Operators

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