Goal
First taste of V1's value ("open any .sqlite file, extract the data") as a working end-to-end tool, ahead of the real steps landing. Extends spike 002's reader (#4/#6) from one hardcoded table to: enumerate all tables via sqlite_master, walk each, and export every table as CSV.
Branch: spike/005_csv_export
Behavior
sqlite-rs-export path/to/mydata.db
# writes, next to the input file:
# path/to/<table>_mydata.csv (one per user table)
- Output naming:
<table>_<file>.csv (file = input basename without extension), written in the same folder as the input
- All user tables from
sqlite_master (skip sqlite_* internal tables; skip virtual tables with a warning — graceful unknowns per Tier 0)
- Header row = column names from the minimal DDL read; rows in rowid order
What this spike de-risks (beyond spike 002)
| Area |
Step it informs |
Multi-table enumeration + root-page resolution from sqlite_master |
step 7 (minimal DDL reader) |
| Multi-page b-trees (interior nodes) on real data |
step 4 |
| Overflow chains, if the chosen fixture has large values |
step 4 |
| CSV value rendering: NULL representation, quoting/escaping, blob encoding (hex?), float formatting |
step 9 (output contract) — spike 002 finding 3 gets a concrete decision |
Experiment (Atomic)
Throwaway crate under tests/spike/005_csv_export/, reusing spike 002's decoding sketch:
- Fixture: a db with 3+ tables, one multi-page (1000+ rows), one with all value types, one with a large TEXT/BLOB (overflow)
- Enumerate
sqlite_master, resolve root pages + column names
- Walk each table b-tree recursively (interior → leaf), decode records
- Write CSVs; oracle-diff each against
sqlite3 -csv "SELECT * FROM <t>"
Falsification criteria
Spike FAILS (valuably) if: interior-node traversal or overflow reassembly has undocumented surprises; or CSV parity with sqlite3 -csv is unreachable without semantic knowledge we don't have at Tier 0 (e.g. affinity-dependent rendering).
Out of scope
WAL (#7), locking (#8), UTF-16, WITHOUT ROWID, index b-trees. Loud asserts on all of these.
Timebox
1-2 days. Findings feed steps 4/7/9 ticket specs; the CSV rendering decisions go into the step 9 output contract.
Exit criteria
🤖 Generated with Claude Code
Goal
First taste of V1's value ("open any .sqlite file, extract the data") as a working end-to-end tool, ahead of the real steps landing. Extends spike 002's reader (#4/#6) from one hardcoded table to: enumerate all tables via
sqlite_master, walk each, and export every table as CSV.Branch:
spike/005_csv_exportBehavior
<table>_<file>.csv(file = input basename without extension), written in the same folder as the inputsqlite_master(skipsqlite_*internal tables; skip virtual tables with a warning — graceful unknowns per Tier 0)What this spike de-risks (beyond spike 002)
sqlite_masterExperiment (Atomic)
Throwaway crate under
tests/spike/005_csv_export/, reusing spike 002's decoding sketch:sqlite_master, resolve root pages + column namessqlite3 -csv "SELECT * FROM <t>"Falsification criteria
Spike FAILS (valuably) if: interior-node traversal or overflow reassembly has undocumented surprises; or CSV parity with
sqlite3 -csvis unreachable without semantic knowledge we don't have at Tier 0 (e.g. affinity-dependent rendering).Out of scope
WAL (#7), locking (#8), UTF-16, WITHOUT ROWID, index b-trees. Loud asserts on all of these.
Timebox
1-2 days. Findings feed steps 4/7/9 ticket specs; the CSV rendering decisions go into the step 9 output contract.
Exit criteria
sqlite3 -csvparity per tablemake spike-005🤖 Generated with Claude Code