QueryLens Facade API
The static QueryLens facade is the main public configuration and batch-validation surface.
Members
Dialect: gets or sets the active globalDialectProfileHasLoadedSchema: true when a schema snapshot is loadedIsFrozen: true after the first validation has locked the runtime configurationLoadDbSchemaFrom(string connectionString): loads a schema snapshot using the selected dialectLoadDbSchemaFrom(string connectionString, DialectProfile dialect): loads a schema snapshot and selects a dialect in one callLoadDbSchemaFromAsync(...): async overloads of schema loadingRefreshDbSchema(): reloads the current snapshot sourceClearDbSchema(): clears the current snapshotReset(): clears dialect, schema, and freeze stateValidateAssembly(Assembly assembly): validates all discovered SQL statements in an assemblyRetrieveSqlStatementsFromAssembly(Assembly assembly): returns discovered statements without validating them
Example
QueryLens.Dialect = DialectProfile.SqlServer2019;
QueryLens.LoadDbSchemaFrom(connectionString);
var result = QueryLens.ValidateAssembly(typeof(OrderQueries).Assembly);
Assert.True(result.AllValid, result.Summary);
Constraints
- Global configuration must be set before validation freezes the runtime.
- Schema loading is currently SQL Server-backed.
- Assembly validation uses the active global runtime level.