End-User Documentation

QL0031 Unused Parameter

QL0031 Unused Parameter

A supplied validation parameter was not referenced by the SQL text.

When It Appears

  • The parameter object includes a property that does not appear in the statement
  • This helps catch stale call-site assumptions or copy-paste drift

Example

var query = new SqlQuery(
    "SELECT * FROM dbo.orders WHERE order_id = @Id",
    validationParameters: new { Id = 42, Status = "Open" });
Assert.Contains(query.Warnings, issue => issue.Code == "QL0031");

Next Steps

  • Remove the extra property or update the SQL to use it intentionally
  • Consider positional placeholder rules when validating SQLite-style SQL