constraintsDependsOnDialect static method
A helper method to make creating defaultConstraints
simpler. Used when
the constraint depends on the dialect.
Used by generated code.
Implementation
static void Function(GenerationContext) constraintsDependsOnDialect(
Map<SqlDialect, String> constraints,
) =>
(context) {
final constraint = constraints[context.dialect];
if (constraint == null || constraint.isEmpty) {
return;
}
context.buffer
..write(' ')
..write(constraint);
};