QueryGrammar class abstract

Compiles a QueryAst into SQL for one dialect (ADR-005). Placeholders are emitted while compiling, never rewritten textually afterwards.

Implementers

Constructors

QueryGrammar()
const

Properties

dialect → SqlDialect
no setter
hashCode → int
The hash code for this object.
no setterinherited
quoteClose → String
no setter
quoteOpen → String
Opening/closing identifier quotes.
no setter
runtimeType → Type
A representation of the runtime type of the object.
no setterinherited
supportsReturning → bool
no setter
supportsSavepoints → bool
no setter

Methods

compileDelete(QueryAst query) → CompiledQuery
compileExists(QueryAst query) → CompiledQuery
compileInsert(String table, List<Map<String, Object?>> rows, {bool ignore = false}) → CompiledQuery
compileInsertGetId(String table, Map<String, Object?> row, String idColumn) → CompiledQuery
Insert returning the generated id (RETURNING when supported).
compileLimitOffset(int? limit, int? offset, Compilation c) → String
LIMIT/OFFSET fragment (MySQL needs a limit when offset is given).
compileSelect(QueryAst query) → CompiledQuery
compileTruncate(String table) → CompiledQuery
compileUpdate(QueryAst query, Map<String, Object?> values) → CompiledQuery
compileUpsert(String table, List<Map<String, Object?>> rows, List<String> uniqueBy, List<String> update) → CompiledQuery
datePart(String part, String column) → String
Expression extracting part from a column (date, year...).
excludedValue(String column) → String
Dialect name for value in upserts (excluded.col / VALUES(col)).
insertKeyword(bool ignore) → String
jsonWhere(String column, String kind, String operator, Object? value, bool not, Compilation c) → String
JSON where fragment (contains / length).
lockClause(LockMode mode) → String
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
parameter(int index) → String
Placeholder for the index-th (1-based) binding.
toString() → String
A string representation of this object.
inherited
wrap(Object identifier) → String
Quotes table.column, column as alias, table.* or *. Invalid characters throw instead of being interpolated (never trust input).
wrapUnion(String sql) → String
Wraps one side of a UNION (SQLite cannot parenthesize selects).

Operators

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

Static Methods

forDialect(SqlDialect dialect) → QueryGrammar
Picks the grammar for dialect.