Part of epic #794 (expands #655). Build the backup engine in `nemarOrg/nemar-db-backup`: - `scripts/lib.sh`: wrangler/cfman wrapper + real-table enumeration (exclude `_cf_*`, `sqlite_*` except sqlite_sequence, `datasets_fts` virtual + 4 shadow tables; keep `d1_migrations`). - `scripts/backup.sh`: capture `schema.sql` from sqlite_master (filtered, tables->indexes->triggers, incl CREATE VIRTUAL TABLE datasets_fts); export each real table via `d1 export --table <t> --no-schema`, concatenate to `data.sql`; write `manifest.json` (timestamp, per-table row counts, schema sha). - Self-verify: load schema.sql+data.sql into a temp sqlite, compare row counts to the manifest, assert FTS rebuilds. Fail loud on mismatch. - Tested against live prod (read-only export) + local sqlite restore round-trip.
Activity