$expandVar method Null safety

String $expandVar(
  1. int start,
  2. int amount
)

Used by generated code to expand array variables.

Implementation

String $expandVar(int start, int amount) {
  final buffer = StringBuffer();
  final mark = executor.dialect == SqlDialect.postgres ? '@' : '?';

  for (var x = 0; x < amount; x++) {
    buffer.write('$mark${start + x}');
    if (x != amount - 1) {
      buffer.write(', ');
    }
  }

  return buffer.toString();
}