3 months ago
6974ea6The npm-published CLI targets Node >=20 but commit 9adbdb4 removed the better-sqlite3 fallback, leaving only bun:sqlite which does not exist under Node. This made the npm CLI crash with Cannot find module bun:sqlite. Fix: - Restore better-sqlite3 fallback in createNativeDatabase - Use Proxy-based adapter that adds .values() while preserving native better-sqlite3 methods (.raw() for drizzle-orm) - Create drizzle-driver.ts: runtime-detect Bun vs Node, use drizzle-orm/bun-sqlite or drizzle-orm/better-sqlite3 accordingly - Add better-sqlite3 as CLI dependency - Mark better-sqlite3 as external in tsup config Verified: node apps/cli/dist/cli.cjs --version/status/list all work under Node 20.19.5. Bun runtime still uses bun:sqlite. Generated with [Devin](https://devin.ai) Co-Authored-By: Devin <158243242+devin-ai-integration[bot]@users.noreply.github.com>
Parentcb84401