buildInsert method

String buildInsert()

Implementation

String buildInsert() {
  final columns = _values.keys.join(', ');

  final placeholders = _dialect is PostgresDialect
      ? _values.keys.map(_dialect.getPlaceholder).join(', ')
      : List.generate(
          _values.length,
          (index) => _dialect.getPlaceholder(index + 1),
        ).join(', ');

  return 'INSERT INTO $_tableName ($columns) VALUES ($placeholders)';
}