End-User Documentation

Use a Per-Statement Dialect Override

Use a Per-Statement Dialect Override

A per-statement dialectProfile override lets one wrapper validate against a different profile than the global runtime default.

When It Helps

  • Mixed-dialect libraries
  • Migration suites
  • Compatibility tests

Example

QueryLens.Dialect = DialectProfile.SqlServer2019;

var sqliteStyleQuery = new SqlQuery(
    "SELECT name FROM customers LIMIT 10",
    dialectProfile: DialectProfile.Sqlite3);

Notes

  • The statement-level profile is passed to the wrapper constructor.
  • Global schema state still matters, so the best results come when the statement and loaded schema belong to compatible dialect families.

Related