Skip to content

Commit ce6fcd5

Browse files
committed
docs: include abstract class and interface rejection in QRY043 docs
The REMEDIATE-phase extension of CheckRowEntityMaterializability added two additional rejection cases (abstract classes and interfaces) that weren't reflected in llm.md, src/Quarry.Generator/README.md, or src/Quarry.Generator/llm.md. Brings the guide text and diagnostic inventory tables in line with the actual QRY043 behavior.
1 parent 390bdd7 commit ce6fcd5

3 files changed

Lines changed: 6 additions & 6 deletions

File tree

llm.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -240,13 +240,13 @@ await db.RawSqlNonQueryAsync("DELETE FROM logs WHERE date < @p0", cutoff);
240240

241241
**Reader strategy:** When the SQL argument is a string literal the shared SQL parser can resolve, the generator emits a static lambda with hardcoded ordinals (one-time `GetOrdinal` lookup eliminated). Otherwise falls back to a `file struct IRowReader<T>``GetName` called once per result set, no per-row lambda or closure allocation. Column matching is case-insensitive (`ToLowerInvariant`).
242242

243-
**Row entity shape:** `RawSqlAsync<T>` and `RawSqlScalarAsync<T>` materialize rows by calling `new T()` and assigning each column to a public settable property. `T` must therefore have:
243+
**Row entity shape:** `RawSqlAsync<T>` and `RawSqlScalarAsync<T>` materialize rows by calling `new T()` and assigning each column to a public settable property. `T` must therefore be a concrete (non-abstract, non-interface) class or struct with:
244244
- a public parameterless constructor, and
245245
- public `get; set;` properties (not `init`-only).
246246

247-
Positional records and init-only properties are rejected at compile time with QRY043. For immutable result shapes, project on a chain query (`Select(x => new Dto { ... })`) — the immutability comes from the projection, not from the row type. Nested row types (declared inside an enclosing class) are supported; the generator emits their fully qualified names in the generated interceptor.
247+
Positional records, init-only properties, abstract classes, and interfaces are rejected at compile time with QRY043. For immutable result shapes, project on a chain query (`Select(x => new Dto { ... })`) — the immutability comes from the projection, not from the row type. Nested row types (declared inside an enclosing class) are supported; the generator emits their fully qualified names in the generated interceptor.
248248

249-
**Diagnostics:** QRY031 (error) — unresolvable generic `T`. QRY041 (warn) — unresolvable column in literal SQL. QRY042 (info + code fix) — RawSqlAsync convertible to chain API. QRY043 (error) — row entity type not materializable (no parameterless ctor / init-only properties).
249+
**Diagnostics:** QRY031 (error) — unresolvable generic `T`. QRY041 (warn) — unresolvable column in literal SQL. QRY042 (info + code fix) — RawSqlAsync convertible to chain API. QRY043 (error) — row entity type not materializable (no parameterless ctor, init-only property, abstract class, or interface).
250250

251251
**Error propagation:** On the buffered multi-row path, `ReadAsync` errors propagate as raw `DbException` (not wrapped in `QuarryQueryException`). Connection-open failures still wrap.
252252

src/Quarry.Generator/README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -485,7 +485,7 @@ public Col<Money> Price => Mapped<MoneyMapping>();
485485
| QRY029 | Sql.Raw placeholder mismatch |
486486
| QRY032 | Query chain not analyzable |
487487
| QRY031 | Unresolvable `RawSqlAsync<T>` generic type parameter |
488-
| QRY043 | Row entity type is not materializable (no parameterless ctor / init-only properties) |
488+
| QRY043 | Row entity type is not materializable (no parameterless ctor, init-only property, abstract class, or interface) |
489489
| QRY033 | Forked query chain (multiple terminals on same builder variable) |
490490
| QRY035 | PreparedQuery escapes method scope |
491491
| QRY036 | PreparedQuery has no terminals |
@@ -560,7 +560,7 @@ await db.RawSqlScalarAsync<int>("SELECT COUNT(*) FROM users");
560560
await db.RawSqlNonQueryAsync("DELETE FROM logs WHERE date < @p0", cutoff);
561561
```
562562

563-
Diagnostics: `QRY031` (unresolvable generic `T`), `QRY041` (unresolvable column in literal SQL), `QRY042` (Raw SQL convertible to chain — info + code fix), `QRY043` (row entity type is not materializable).
563+
Diagnostics: `QRY031` (unresolvable generic `T`), `QRY041` (unresolvable column in literal SQL), `QRY042` (Raw SQL convertible to chain — info + code fix), `QRY043` (row entity type not materializable — no parameterless ctor, init-only property, abstract class, or interface).
564564

565565
---
566566

src/Quarry.Generator/llm.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -427,7 +427,7 @@ All pipeline models implement `IEquatable<T>` for incremental caching.
427427
| QRY040 | Warning | SQL manifest write failure |
428428
| QRY041 | Warning | RawSqlAsync column expression without alias (falls back to runtime ordinal discovery) |
429429
| QRY042 | Info | RawSqlAsync convertible to chain query (code fix available) |
430-
| QRY043 | Error | Row entity type not materializable (no parameterless ctor / init-only properties) |
430+
| QRY043 | Error | Row entity type not materializable (no parameterless ctor, init-only property, abstract class, or interface) |
431431
| QRY044 | Warning | `[QuarryContext]` namespace missing from `<InterceptorsNamespaces>` |
432432
| QRY050-055 | Mixed | Migration diagnostics |
433433
| QRY060 | Error | No FK column for `One<T>` navigation |

0 commit comments

Comments
 (0)