A library for migrating nested and multi-dimensional JSON data to/from SQLite databases using better-sqlite3-helper. Version 3.1.10 is stable, with active maintenance. It supports both runtime composition and code generation for ~50% speed improvement. Key differentiators: schema-driven normalization, bulk inserts with transactions, and caching of normalized values to reduce duplication. Suitable for large datasets (e.g., 8GiB proxy logs) with significant storage savings (e.g., 11% of plain text size). Includes TypeScript types via shipped definitions.
npm install better-sqlite3-schemaNo compatibility data collected yet for this library.
Verified import paths — ran on the pinned version, not inferred.
Demonstrates defining TableSchema, creating tables via makeSchemaScanner, inserting a row with makeInsertRowFnFromSchema, and querying back using better-sqlite3 directly.
Use dynamic import() in CommonJS projects or switch to ES modules.
Migrate to makeInsertRowFnFromSchema or makeDeduplicatedInsertRowFnFromSchema.
Run: npm install @beenotung/better-sqlite3-helper @types/better-sqlite3 @types/integer
Use consistent naming: e.g., refField 'type' refers to column 'type' in the same or related table, but must be defined as a field in the parent schema.
Set PRAGMA synchronous = OFF, PRAGMA journal_mode = MEMORY, and increase cache_size before bulk operations.
Monitor memory usage and reduce batch size or implement custom caching strategy for very large datasets.
Install the missing peer dependency: npm install @beenotung/better-sqlite3-helper
Use named import: import { makeSchemaScanner } from 'better-sqlite3-schema'Switch to import syntax or use dynamic import: const pkg = await import('better-sqlite3-schema')Drop tables before creation or use IF NOT EXISTS: db.exec('CREATE TABLE IF NOT EXISTS thread (...)')