Clause class abstract
A self-contained, renderable fragment of a SQL statement and the unit of extension for dialect authors.
A clause renders through RenderContext mechanics only (identifier
escaping and bind parameters), so the core clauses compose unchanged
across dialects. To emit SQL the core doesn't model like ON CONFLICT,
OR IGNORE, a
dialect-specific LIMIT you implement your own Clause and slot it into a
statement with withClause:
class _OrIgnore extends Clause {
const _OrIgnore();
@override
String render(RenderContext w) => 'OR IGNORE';
}
// Place it just after the INSERT verb (see the *Slot weights):
builder.withClause(
InsertSlot.verb + 500,
(_) => const _OrIgnore(),
InsertValuesBuilder.new,
);
Constructors
- Clause()
-
A self-contained, renderable fragment of a SQL statement and the unit of
extension for dialect authors.
const
Properties
- hashCode → int
-
The hash code for this object.
no setterinherited
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
Methods
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
render(
RenderContext context) → String -
Renders this clause to SQL text, recording any bind values on
context. -
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited