feat(drizzle): update with postgres and mysql connectors#219
Conversation
Restructure drizzle integration into dialect-specific subdirectories (`sqlite/`, `postgres/`) with backwards-compatible re-exports from the main entry point. - Add `db0/integrations/drizzle/postgres` with full PgSession, PgTransaction, and PgPreparedQuery implementations - Move SQLite session into `sqlite/` subdirectory - Implement transactions and nested savepoints for both dialects - Implement `values()` for SQLite (converts object rows to arrays) - Use `fillPlaceholders` for proper placeholder handling - Remove unused `_utils.ts` (mapResultRow no longer needed) - Add pglite-based tests for the postgres connector Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
|
Caution Review failedThe pull request is closed. ℹ️ Recent review info⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (13)
📝 WalkthroughWalkthroughThe PR refactors the Drizzle ORM integration from a single generic DB0 layer to database-specific implementations for SQLite, PostgreSQL, and MySQL. Each database now has dedicated session, transaction, and prepared query classes with updated test coverage and a restructured public API. Changes
Estimated code review effort🎯 4 (Complex) | ⏱️ ~60 minutes The review requires verification of three parallel database-specific implementations following similar architectural patterns (session → transaction → prepared query), assessment of each database's unique control flow (particularly transaction and savepoint handling), validation of API surface changes and backward compatibility via re-exports, and confirmation that test coverage adequately replaces the removed monolithic tests. The heterogeneity of database-specific logic combined with architectural restructuring increases cognitive load. Poem
✨ Finishing Touches
🧪 Generate unit tests (beta)
📝 Coding Plan
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Add `db0/integrations/drizzle/mysql` with full MySqlSession, MySqlTransaction, and MySqlPreparedQuery implementations. - Supports transactions with isolation level, access mode, and consistent snapshot config - Nested transactions via savepoints (InnoDB) - Supports `mode` option for planetscale compatibility - Add mysql2 test (behind MYSQL_URL env check) Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Summary
sqlite/,postgres/,mysql/) with backwards-compatible re-exportsdb0/integrations/drizzle/postgreswith fullPgSession,PgTransaction, andPgPreparedQueryimplementationsdb0/integrations/drizzle/mysqlwith fullMySqlSession,MySqlTransaction, andMySqlPreparedQueryimplementationsvalues()for SQLite,fillPlaceholdersfor proper placeholder handling_utils.ts(mapResultRowno longer needed since db0 returns object rows)New structure
Usage
Test plan
MYSQL_URLenv check)🤖 Generated with Claude Code
Summary by CodeRabbit
Refactor
New Features
Tests