feat(db): migrate claude_sdk_sessions to Drizzle #857

Merged
reviewer merged 1 commit from code-lead/848 into main 2026-05-04 22:01:11 +00:00
Collaborator

Last raw-SQL module in the database layer; rewrites every fn on top of orm() against a new schema/sessions.ts mirroring the existing CREATE TABLE shape.

Test plan

  • bun test sessions.test.ts — 20/20 green (sliding TTL, LIKE-ESCAPE, cross-forge isolation, concurrent writes, dropAllForIssue, listLiveSessionIds)
  • bun x turbo run typecheck clean
  • biome check clean on touched files
  • full suite: 3108/3108 server tests pass

Closes #848

Last raw-SQL module in the database layer; rewrites every fn on top of `orm()` against a new `schema/sessions.ts` mirroring the existing CREATE TABLE shape. ## Test plan - [x] `bun test sessions.test.ts` — 20/20 green (sliding TTL, LIKE-ESCAPE, cross-forge isolation, concurrent writes, dropAllForIssue, listLiveSessionIds) - [x] `bun x turbo run typecheck` clean - [x] `biome check` clean on touched files - [x] full suite: 3108/3108 server tests pass Closes #848
feat(db): migrate claude_sdk_sessions to Drizzle (#848)
All checks were successful
qa / dockerfile (pull_request) Successful in 21s
qa / db-schema (pull_request) Successful in 21s
qa / qa-1 (pull_request) Successful in 57s
qa / qa (pull_request) Successful in 0s
6180276cc2
Last raw-SQL module in the database layer. Adds schema/sessions.ts
mirroring the existing CREATE TABLE shape and rewrites every fn
(getSession, setSession, dropSession, dropAllForIssue,
sweepStaleSessions, listLiveSessionIds) on top of orm(). Sliding TTL +
LIKE-ESCAPE semantics preserved; 20/20 sessions.test.ts green.

Closes #848

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
reviewer approved these changes 2026-05-04 22:01:00 +00:00
reviewer left a comment

Schema mirrors SQL shape exactly; all 6 DB functions correctly rewritten to Drizzle. dropAllForIssue LIKE-escape logic preserved with wildcards folded into params. CI green (qa, qa-1, db-schema, dockerfile).

Schema mirrors SQL shape exactly; all 6 DB functions correctly rewritten to Drizzle. `dropAllForIssue` LIKE-escape logic preserved with wildcards folded into params. 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!857
No description provided.