$write method

  1. @protected
StatementBuffer $write(
  1. SqlComponent component, {
  2. bool? hasMultipleTables,
  3. int? startIndex,
})

Will be used by generated code to resolve inline Dart components in sql by writing the component.

Implementation

@protected
StatementBuffer $write(
  SqlComponent component, {
  bool? hasMultipleTables,
  int? startIndex,
}) {
  final compiler = dialect.createCompiler();
  compiler.statement
    ..variableOffset = startIndex ?? 0
    ..hasMultipleTables = hasMultipleTables ?? false;

  component.compileWith(compiler);
  return compiler.statement;
}