Clause constructor

const Clause()

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,
);

Implementation

const Clause();