compile method
Compiles SQL and bound parameters without executing the template.
arguments must contain exactly parameters, each represented by a bound
value expression. Dialect mismatches and parameter overflow are rejected.
Implementation
SqlCommand compile(
Capabilities capabilities,
Map<String, Expr<Object?>> arguments,
) {
final w = SqlWriter(
capabilities.dialect,
{},
exactDecimal: capabilities.exactDecimal,
temporal: capabilities.temporal,
);
final sql = writeQuery(w, arguments);
final command = w.finish(sql);
if (command.parameters.length > capabilities.maxParameters) {
throw const OrmException(
'QUERY.PARAMETERS',
'Named SQL exceeds the parameter limit.',
);
}
return command;
}