$writeInsertable method Null safety

  1. @protected
GenerationContext $writeInsertable(
  1. TableInfo<Table, dynamic> table,
  2. Insertable insertable,
  3. {int? startIndex}
)

Writes column names and VALUES for an insert statement.

Used by generated code.

Implementation

@protected
GenerationContext $writeInsertable(TableInfo table, Insertable insertable,
    {int? startIndex}) {
  final context = GenerationContext.fromDb(this)
    ..explicitVariableIndex = startIndex;

  table.validateIntegrity(insertable, isInserting: true);
  InsertStatement(this, table)
      .writeInsertable(context, insertable.toColumns(true));

  return context;
}