Skip to content

Implement the SQLite dumper - #1

Merged
Stelinkaa merged 1 commit into
masterfrom
claude/cool-bohr-ot2x0l
Sep 30, 2026
Merged

Stelinkaa merged 1 commit into
masterfrom
claude/cool-bohr-ot2x0l

Conversation

@Stelinkaa

Copy link
Copy Markdown
Contributor

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

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
@Stelinkaa
Stelinkaa merged commit 768f075 into master Sep 30, 2026
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants