Atomic Write-Read Workflows

Tangled, duplicated query paths contrasted with a clear composable query graph that produces reviewable SQL.

The issue

Some application operations must update data and immediately use the affected rows in a later read: advance a workflow, update a balance, record a state transition, then return the result for a screen or API response. Whether the query is handwritten or built through a local API, teams often hand-order CTEs, wire fragments together, or split the workflow across multiple statements. That makes dependency order, transaction boundaries, and reuse hard to reason about.

How DBQC helps

DBQC models DML and downstream reads as composed query nodes. For supported workflows, an update or insert with returned rows can feed the next part of the query graph, and the compiler emits the required dependency-ordered statement. The application still executes that statement through its own driver and transaction boundary.

Work required

Model the write and its downstream reads in DBQC, define the result schema, and test the generated statement against the target database. Keep transaction orchestration for multi-statement business processes in the application or driver layer; DBQC compiles the composed query itself.

Benefits

Return to Use Cases.