Query Passes In Generic Mode but Fails In Dialect Mode
Generic mode is intentionally permissive, so a statement can pass Level 1 and still fail once a specific dialect profile is selected.
Common Causes
- Unknown functions
- Version-gated functions
- Reserved words
- Dialect-specific syntax restrictions
What To Check
- Confirm the chosen
DialectProfilematches the engine and version you actually target. - Keep the stricter dialect profile if the new failure reflects real production behavior.
Example
var genericQuery = new SqlQuery("SELECT TOP 10 name FROM customers");
Assert.True(genericQuery.IsValid);
QueryLens.Reset();
QueryLens.Dialect = DialectProfile.Sqlite3;
var sqliteQuery = new SqlQuery("SELECT TOP 10 name FROM customers");
Assert.False(sqliteQuery.IsValid);