Skip to content

cli: OS_DATABASE_DRIVER=memory is advertised but serve.ts has no dispatch branch (falls through to SQLite) #3276

Description

@os-zhuang

The CLI advertises memory as a database driver — --database-driver … | memory (packages/cli/src/commands/dev.ts:88), and OS_DATABASE_DRIVER=memory is special-cased in dev (dev.ts:41; resolveDefaultDevDbUrl at dev.ts:40-42).

But packages/cli/src/commands/serve.ts's driver dispatch has no memory branch (verified by grep). So OS_DATABASE_DRIVER=memory falls through to the isDev SQLite default (resolveSqliteDriver at :memory:), yielding SQLite-in-memory, not the mingo InMemoryDriver. The InMemoryDriver is only reached if both native better-sqlite3 and the wasm fallback fail to load.

Impact: declared ≠ enforced — selecting the memory driver silently gives a different engine than intended.

Fix: add a driverType === 'memory' branch in the serve.ts dispatch that returns the InMemoryDriver.

Found during the #1880 docs implementation-accuracy audit (PR #3243); out of scope for that docs-only PR.

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions