Querying & Raw SQL
Where a query is declared and in what form: behind a data-access interface, as an object-level string, a typed builder, or hand-written SQL. Asked because the form decides refactoring safety.
on this pageshowhide
explore
- Repository Boundary4 questions
- Authoring Styles & Typed DSLs5 questions
- Dynamic Predicate Composition5 questions
- Projections & Transfer Models5 questions
- Native Statements & Row Mapping6 questions
- Bulk Writes & Streaming Reads6 questions
- Layers Without Tracking5 questions
questions
page 2 of 2As a lead, how would you pick a house query-authoring style for a large, long-lived codebase?
basics
~20 sScore the codebase on rename safety, control of emitted SQL, portability, readability at three joins, runtime assembly, discoverability and build cost; then set one default, one named escape hatch, and an enforcement point. Mixed styles collapse to the weakest.
What do read paths that project lose from the mapped model's invariants, and how do you stop the two drifting?
basics
~20 sThey lose behaviour the mapped model carried - derived values, rounding rules, visibility and soft-delete predicates - and must re-express it in the statement. The rule then exists twice, and only a shared test keeps the copies honest.
A team defends its data-access interfaces by saying the store can be swapped underneath. How would you evaluate that claim?
basics
~20 sInterfaces preserve method names and result shapes, not semantics. Write-back of tracked objects, multi-call atomicity, conflict behaviour, ordering stability and latency do not travel. Keep the boundary for naming, fetch-plan ownership and testability, not portability.
When is a data-access layer with no tracked set the right choice for a service, and what does it cost?
basics
~20 sIt fits set-shaped and read-heavy work, bulk and streaming paths, latency-sensitive endpoints and shapes close to the tables. It costs hand-assembled graphs, hand-ordered writes, hand-written concurrency checks, and discipline enforced by review rather than by the layer.
How does a data-access layer invoke a server-side routine, and how do results come back to the caller?
basics
~20 sA layer calls a routine through a callable form declaring each parameter's direction, not through a plain query. Results arrive as result sets, as output parameter values, or as a returned value, consumed in that order.
showing 31–36 of 36