Implement the SQLite dumper - #1
Merged
Merged
Conversation
Standalone, client-agnostic SQLite dump and restore library for Node.js, built the same way as the MySQL, PostgreSQL, SQL Server and Redis dumpers: a driver-agnostic connection contract, introspection into a normalized model, a pure archive planner and renderer, streaming row export, and a streaming restore with session cleanup. better-sqlite3 is an optional peer dependency behind the dbgate-sqlite-dumper/better-sqlite3 entry point. Dumps are byte-identical to the sqlite3 shell's .dump (and its --data-only, --preserve-rowids, --newlines and --nosys variants), apart from REAL digits past the 17th, which come from SQLite's own printf and differ between SQLite releases. Values are rendered by SQLite itself, so 64-bit integers, REAL digits and text bytes are exact with any driver. The restore splits scripts exactly where the shell does, by porting sqlite3_complete() and the shell's line rules (GO and / terminators, dot commands, # comments, CR before LF), lifts defensive mode for virtual-table dumps, and puts foreign_keys, writable_schema and any script transaction back afterwards. Unit tests run against in-memory better-sqlite3 databases; integration tests prove two-way interop with the real sqlite3 shell. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Dq3ejuEmztzJmrt9fSzPjq
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 free
to 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.
Standalone, client-agnostic SQLite dump and restore library for Node.js, built the same way as the MySQL, PostgreSQL, SQL Server and Redis dumpers: a driver-agnostic connection contract, introspection into a normalized model, a pure archive planner and renderer, streaming row export, and a streaming restore with session cleanup. better-sqlite3 is an optional peer dependency behind the dbgate-sqlite-dumper/better-sqlite3 entry point.
Dumps are byte-identical to the sqlite3 shell's .dump (and its --data-only, --preserve-rowids, --newlines and --nosys variants), apart from REAL digits past the 17th, which come from SQLite's own printf and differ between SQLite releases. Values are rendered by SQLite itself, so 64-bit integers, REAL digits and text bytes are exact with any driver.
The restore splits scripts exactly where the shell does, by porting sqlite3_complete() and the shell's line rules (GO and / terminators, dot commands, # comments, CR before LF), lifts defensive mode for virtual-table dumps, and puts foreign_keys, writable_schema and any script transaction back afterwards.
Unit tests run against in-memory better-sqlite3 databases; integration tests prove two-way interop with the real sqlite3 shell.
Claude-Session: https://claude.ai/code/session_01Dq3ejuEmztzJmrt9fSzPjq