Multi-Format Import & Reconciliation (jouledb migrate)
crates/joule-db-server/src/live_migration.rs provides a parser, canonicalizer, and order-independent BLAKE3 multiset checksum tool for importing structured exports into JouleDB (v0.12.0 preview).
Supported Input Formats
--from Flag | Input File / Payload | Parser Scope |
|---|---|---|
sqlite | Binary .db / .sqlite file (via local sqlite3 .dump) or .sql dump | Simple CREATE TABLE + INSERT INTO value tuples |
postgres / mysql | .sql dump (CREATE TABLE + INSERT INTO) | Standard literal tuples (NULL, integers, floats, single-quoted strings); does not parse arbitrary COPY ... FROM stdin or PL/pgSQL procedures |
mongo | MongoDB Extended JSONL (mongoexport one JSON object per line) | Unwraps $oid, $numberDecimal, $numberLong, $numberInt |
elastic | Elasticsearch _bulk NDJSON | Pairs action metadata lines (index/create) with document lines |
csv / jsonl | Headered RFC-4180 CSV or newline-delimited JSON | Infers integer, float, boolean, and string scalars |
Multiset BLAKE3 Checksum & Replay
- Order-Independent Multiset Digest: Each normalized record is hashed with
BLAKE3and combined via wrapping128-bit sum andXORaccumulators, verifying whether source and target row sets match regardless of scan order. - Optional Delta Event Replay: Applies ordered
INSERT/UPDATE/DELETEJSON change events after snapshot load during testing or staged cutover, then signs the JSON receipt withML-DSA-65(inv-pqcrypto).
# Import a local SQLite database file and verify multiset BLAKE3 parity
jouledb migrate --from sqlite --input ./legacy_app.db
# Run the built-in 4-format parser & reconciliation smoke check
jouledb migrate