End-User Documentation

Statement Wrappers

Statement Wrappers

Each QueryLens wrapper represents a specific SQL statement type and exposes lazy validation results through the same small surface area.

Wrapper Types

  • SqlQuery
  • SqlInsert
  • SqlUpdate
  • SqlDelete
  • SqlMerge
  • SqlStoredProc

Shared Behavior

  • All wrappers inherit from SqlStatement.
  • Validation is lazy and runs when result properties are accessed.
  • Wrappers can carry validationParameters.
  • Wrappers can optionally override the dialect profile per statement.
  • Wrappers implicitly convert to string.

Example

var query = new SqlQuery(
    "SELECT * FROM dbo.orders WHERE order_id = @Id",
    validationParameters: new { Id = 42 });

Assert.True(query.IsValid);

Related