feat(db): extract holds aggregate to Drizzle (#840) #855

Merged
reviewer merged 1 commit from code-lead/840 into main 2026-05-04 21:42:44 +00:00
Collaborator

Pilot Drizzle migration on the smallest aggregate (holds, 4 fns) — proves the bridge pattern before the load-bearing aggregates land.

  • New infrastructure/database/holds.ts with addHold / removeHold / hasHold / listHolds rewritten on the Drizzle query builder; HoldRow re-exported under same name.
  • New schema/holds.ts mirroring the existing SQL shape (snake_case TS fields, bridge style).
  • New db/client.ts::orm() — recompute per call; pinned to the shared getDb() handle so there's no second connection.
  • Hold fns deleted from db.ts; callers in domain/workflow/{deps,event-handlers}.ts updated.

Test plan

  • holds.test.ts covers add/has/remove/list + idempotency + Drizzle ↔ raw getDb().query(...) round-trip
  • deps.test.ts (62) still green — applyHoldCommand integration unchanged
  • Full server suite: 3108 pass / 0 fail
  • bun x turbo run typecheck + Biome check + format clean

Closes #840

Pilot Drizzle migration on the smallest aggregate (`holds`, 4 fns) — proves the bridge pattern before the load-bearing aggregates land. - New `infrastructure/database/holds.ts` with `addHold` / `removeHold` / `hasHold` / `listHolds` rewritten on the Drizzle query builder; `HoldRow` re-exported under same name. - New `schema/holds.ts` mirroring the existing SQL shape (snake_case TS fields, bridge style). - New `db/client.ts::orm()` — recompute per call; pinned to the shared `getDb()` handle so there's no second connection. - Hold fns deleted from `db.ts`; callers in `domain/workflow/{deps,event-handlers}.ts` updated. ## Test plan - [x] `holds.test.ts` covers add/has/remove/list + idempotency + Drizzle ↔ raw `getDb().query(...)` round-trip - [x] `deps.test.ts` (62) still green — applyHoldCommand integration unchanged - [x] Full server suite: 3108 pass / 0 fail - [x] `bun x turbo run typecheck` + Biome check + format clean Closes #840
feat(db): extract holds aggregate to Drizzle (#840)
All checks were successful
qa / dockerfile (pull_request) Successful in 15s
qa / db-schema (pull_request) Successful in 33s
qa / qa-1 (pull_request) Successful in 1m15s
qa / qa (pull_request) Successful in 0s
9e3cef5d18
Pilot Drizzle migration on the smallest aggregate before tackling the
load-bearing ones. Adds `schema/holds.ts`, `db/client.ts::orm()` (no
memo), and rewrites the four hold-CRUD fns onto the Drizzle query
builder pinned to the shared `getDb()` handle. Callers in
`domain/workflow/{deps,event-handlers}.ts` now import from
`infrastructure/database/holds`.
reviewer approved these changes 2026-05-04 21:42:36 +00:00
reviewer left a comment

Correct extraction. All 4 ACs met: holds.ts + schema/holds.ts + db/client.ts added; callers updated in deps.ts, deps.test.ts, event-handlers.ts; old fns deleted from db.ts; orm() recomputes per call. Round-trip test + idempotency covered. CI green (qa, qa-1, db-schema, dockerfile).

Correct extraction. All 4 ACs met: `holds.ts` + `schema/holds.ts` + `db/client.ts` added; callers updated in `deps.ts`, `deps.test.ts`, `event-handlers.ts`; old fns deleted from `db.ts`; `orm()` recomputes per call. Round-trip test + idempotency covered. CI green (qa, qa-1, db-schema, dockerfile).
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!855
No description provided.