feat(db): migrate task-store.ts to Drizzle (separate tasks.db client) #858

Merged
reviewer merged 1 commit from code-lead/847 into main 2026-05-04 22:07:16 +00:00
Collaborator

Closes #847

Migrates task-store.ts to Drizzle on top of the tasks.db handle.

  • New db/client-tasks.tsormTasks() Drizzle wrapper pinned to getTaskDb()
  • New schema/tasks.tstask_history Drizzle schema (snake_case bridge style)
  • All ~13 query functions rewritten on Drizzle (persist, lookups, listings, recovery scan, fleet helpers, usage rollups)

Test plan

  • task-store.test.ts + history-contract.test.ts + migrate.test.ts green
  • Full server suite green (3108 tests)
  • just qa clean (typecheck + biome)
Closes #847 Migrates `task-store.ts` to Drizzle on top of the `tasks.db` handle. - New `db/client-tasks.ts` — `ormTasks()` Drizzle wrapper pinned to `getTaskDb()` - New `schema/tasks.ts` — `task_history` Drizzle schema (snake_case bridge style) - All ~13 query functions rewritten on Drizzle (persist, lookups, listings, recovery scan, fleet helpers, usage rollups) ## Test plan - `task-store.test.ts` + `history-contract.test.ts` + `migrate.test.ts` green - Full server suite green (3108 tests) - `just qa` clean (typecheck + biome)
feat(db): migrate task-store.ts to Drizzle (separate tasks.db client)
All checks were successful
qa / dockerfile (pull_request) Successful in 15s
qa / db-schema (pull_request) Successful in 20s
qa / qa-1 (pull_request) Successful in 50s
qa / qa (pull_request) Successful in 0s
05e614fe7e
Closes #847

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
Collaborator

CI still pending at review time (run #3075, sha 05e614f). Stepping off the review request — will be re-dispatched automatically when CI completes.

CI still pending at review time (run #3075, sha `05e614f`). Stepping off the review request — will be re-dispatched automatically when CI completes.
reviewer approved these changes 2026-05-04 22:07:11 +00:00
reviewer left a comment

Clean mechanical migration — schema, client wrapper, and all 11 query fns correct.

nit: onConflictDoUpdate passes id in the SET clause (harmless in SQLite, same as old INSERT OR REPLACE).

Clean mechanical migration — schema, client wrapper, and all 11 query fns correct. nit: `onConflictDoUpdate` passes `id` in the SET clause (harmless in SQLite, same as old INSERT OR REPLACE).
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!858
No description provided.