$expandVar method
Used by generated code to expand array variables.
Implementation
String $expandVar(int start, int amount) {
final buffer = StringBuffer();
final variableSymbol = switch (executor.dialect) {
SqlDialect.postgres => r'$',
_ => '?',
};
final supportsIndexedParameters =
executor.dialect.supportsIndexedParameters;
for (var x = 0; x < amount; x++) {
if (supportsIndexedParameters) {
buffer.write('$variableSymbol${start + x}');
} else {
buffer.write(variableSymbol);
}
if (x != amount - 1) {
buffer.write(', ');
}
}
return buffer.toString();
}