feat(db): extract flows aggregate to Drizzle (#843) #865

Merged
reviewer merged 1 commit from code-lead/843 into main 2026-05-04 23:17:58 +00:00
Collaborator

Splits flows / flow_runs / flow_node_runs / flow_audit / legacy_forge_calls out of db.ts into per-table Drizzle modules.

Test plan

  • bun x turbo run typecheck lint clean
  • bun test apps/server — 3154 pass / 0 fail
  • flows-db.test.ts — 38 pass; new withFlowTransaction cross-aggregate test rolls back Drizzle flows + Drizzle holds + still-raw pr_dependencies writes inside one closure (and commits all three on normal return)
  • sql-layer-check — no new raw bun:sqlite imports outside infrastructure/database/

Closes #843

Splits flows / flow_runs / flow_node_runs / flow_audit / legacy_forge_calls out of db.ts into per-table Drizzle modules. ## Test plan - bun x turbo run typecheck lint clean - bun test apps/server — 3154 pass / 0 fail - flows-db.test.ts — 38 pass; new withFlowTransaction cross-aggregate test rolls back Drizzle flows + Drizzle holds + still-raw pr_dependencies writes inside one closure (and commits all three on normal return) - sql-layer-check — no new raw bun:sqlite imports outside infrastructure/database/ Closes #843
feat(db): extract flows aggregate to Drizzle (#843)
All checks were successful
qa / sql-layer-check (pull_request) Successful in 12s
qa / dockerfile (pull_request) Successful in 13s
qa / db-schema (pull_request) Successful in 26s
qa / qa-1 (pull_request) Successful in 48s
qa / qa (pull_request) Successful in 0s
06405bb96f
Splits flows / flow_runs / flow_node_runs / flow_audit / legacy_forge_calls
out of the db.ts god-file into per-table Drizzle modules. Adds a cross-
aggregate transaction test proving withFlowTransaction rolls back Drizzle
flows + Drizzle holds + still-raw pr_dependencies writes inside one closure.

Closes #843
reviewer approved these changes 2026-05-04 23:17:46 +00:00
reviewer left a comment

All acceptance criteria from issue #843 met: all 21 functions extracted across 4 cohesive modules (flows.ts, flow-runs.ts, flow-audit.ts, legacy-forge-calls.ts), 4 Drizzle schema files added, withFlowTransaction keeps the same signature with correct connection-scoped semantics, and the cross-aggregate rollback test proves Drizzle + raw SQL writes revert together.

Nit (non-blocking): listFlowNodeIntentsSince test is placed inside the legacy_forge_calls describe block rather than its own — no functional issue, just slightly surprising grouping.

All acceptance criteria from issue #843 met: all 21 functions extracted across 4 cohesive modules (flows.ts, flow-runs.ts, flow-audit.ts, legacy-forge-calls.ts), 4 Drizzle schema files added, withFlowTransaction keeps the same signature with correct connection-scoped semantics, and the cross-aggregate rollback test proves Drizzle + raw SQL writes revert together. Nit (non-blocking): `listFlowNodeIntentsSince` test is placed inside the `legacy_forge_calls` describe block rather than its own — no functional issue, just slightly surprising grouping.
Sign in to join this conversation.
No reviewers
No milestone
No project
No assignees
2 participants
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
charles/claude-hooks!865
No description provided.