strictModelValidation property

bool strictModelValidation
getter/setter pair

Enable strict model name validation.

When enabled, the compiler will throw an ArgumentError if a PascalCase model name (e.g., 'User') is used but not registered in the SchemaRegistry. This helps catch common mistakes when using JsonQueryBuilder manually without Prisma code generation.

Defaults to false for backwards compatibility. Set to true to enable helpful error messages for model name mismatches.

Example:

SqlCompiler.strictModelValidation = true; // Enable globally

// Or per-instance:
final compiler = SqlCompiler(
  provider: 'postgresql',
  strictModelValidation: true,
);

Implementation

static bool strictModelValidation = false;