End-User Documentation

QueryLens Manual

QueryLens Manual

Validate raw SQL at test time, not runtime.

QueryLens gives Dapper, ADO.NET, and query-registry codebases a lightweight way to catch broken SQL before production code executes it. The main workflow is small on purpose: wrap SQL in a statement type, optionally choose a DialectProfile, optionally load a schema snapshot, then assert IsValid and inspect diagnostics.

Start Here

Validation Levels

Level Trigger What it adds
1 Default Permissive, cross-dialect structural SQL validation
2 QueryLens.Dialect = ... Dialect-specific syntax, reserved words, functions, and version checks
3 QueryLens.LoadDbSchemaFrom(...) Table, column, procedure, and schema-backed write validation

Compact Example

var query = new SqlQuery("SELECT customer_id, status FROM dbo.orders WHERE order_id = @Id");

Assert.True(query.IsValid, query.ErrorSummary);

Main Paths