Enable Dialect Validation
Setting QueryLens.Dialect switches validation from generic syntax mode to a specific dialect and version profile.
Steps
- Choose the profile that matches the engine and version you actually target.
- Set
QueryLens.Dialectbefore any validation runs. - Validate the statement again and inspect any new dialect-aware diagnostics.
- Keep profile selection in shared test setup so the whole suite uses the same assumptions.
Example
QueryLens.Dialect = DialectProfile.SqlServer2019;
var sqlServerQuery = new SqlQuery("SELECT STRING_AGG(name, ',') FROM departments");
Assert.True(sqlServerQuery.IsValid);
QueryLens.Reset();
QueryLens.Dialect = DialectProfile.Sqlite3;
var sqliteQuery = new SqlQuery("SELECT TOP 10 name FROM departments");
Assert.False(sqliteQuery.IsValid);