Uh oh!
There was an error while loading. Please reload this page.
feat!: 2.0 — both-engines config, sqlSwitch rename, db.reconnect() - #20
Merged
Conversation
BREAKING CHANGE: DALConfig.db is now a 'local' | 'cloud' selector with local?/cloud? blocks declared alongside it; the per-block `mode` field is removed. Every declared block is validated eagerly at connect(), and a db: 'cloud' with no cloud block throws ConfigurationError. - rename createDAL() -> sqlSwitch() (factory + default export); createDAL kept as a one-line @deprecated alias, removed in 3.0 - add db.reconnect(target?): restart / recover a wedged connection, or repoint to the other declared engine without moving data. fail-safe (new engine built + validated before the old one is torn down) and flushes pending writes first. engineSwap() stays a pure data-mover. - bump to 2.0.0 across root + scoped package (version + dep pin) - docs: README, CHANGELOG 2.0.0 entry, CLAUDE.md public-API invariant - tests: reconnect.test.ts + factory-rename.test.ts
- architecture.svg: shrink the engineSwap caption to 13px so "resumable" stops overflowing the box; "collapses repeats" -> "collapse repeats" so the "w" in "now" no longer touches the card edge - hero.svg: replace the hardcoded "npm 1.0.1" (had to be hand-edited every release) with the always-true "ESM + CJS"; a live version belongs in a shields.io README badge, not a static committed SVG - hero.svg: mode: 'local'/'cloud' -> db: 'local'/'cloud' to match the 2.0 both-engines config shape
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for freeto join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Breaking 2.0 release. Reshapes the config to declare both engines up front, renames the factory, and adds a
db.reconnect()primitive.DALConfig.dbis now a'local' | 'cloud'selector withlocal?/cloud?blocks declared alongside it. The per-blockmodefield is removed. Every declared block is validated eagerly atconnect(), so a bad cloudconnectionStringis caught at boot even while runningdb: 'local';db: 'cloud'with nocloudblock throwsConfigurationError.createDAL()→sqlSwitch():sqlSwitchis the factory and default export.createDALstays as a one-line@deprecatedalias (removed in 3.0).db.reconnect(target?): one primitive for three jobs — restart a wedged connection, recover a lost one, or repoint to the other declared engine without moving data. Fail-safe: the replacement engine is built and validated before the old one is torn down, and pending writes are flushed first.engineSwap()stays a pure data-mover.CHANGELOG.md(2.0.0 entry + migration notes),CLAUDE.mdpublic-API invariant; bumped to2.0.0across root + scoped package (version + dep pin).architecture.svgengineSwap caption shrunk to 13px so "resumable" stops overflowing; "collapses repeats" → "collapse repeats".hero.svgdrops the hand-editednpm 1.0.1chip for the always-trueESM + CJS, andmode:→db:to match the 2.0 shape.Related issue
none
Type of change
How it was tested
Logic + fakedriver tests pass locally (including the new
test/reconnect.test.tsandtest/factory-rename.test.ts). The real-SQLite/Postgres integration matrix could not run in the Replit sandbox (nativebetter-sqlite3ABI mismatch segfaults the Vitest fork) — that matrix runs authoritatively in CI on Node 22/24 once this lands onmain.Checklist
pnpm docs)src/database/index.ts) changes are intentional and called out aboveCLAUDE.mdSupersedes #19 (rebased onto current
mainto drop a duplicate README commit that was showing as a conflict).