# SQLite Persistence Validation

Last run: 2026-07-21

Phase 2 stores parser output in a local SQLite database using `sql.js`. The Electron app writes the production database to:

```text
<Electron userData>/dynasty-live.sqlite
```

Imported saves are copied into:

```text
<Electron userData>/archive/<dynasty-id>/
```

## Smoke Test

The smoke test loaded `out/parser/latest-snapshot.json`, wrote it to `out/parser/phase2-smoke.sqlite`, attempted to write the same snapshot a second time, then loaded the latest snapshot from SQLite.

Result:

- First import snapshot ID: `1`
- Duplicate import snapshot ID: `1`
- Dedupe passed: yes

Stored row counts:

- `dynasty`: 1
- `snapshot`: 1
- `conference`: 12
- `team`: 143
- `coach`: 497
- `player`: 12,148
- `game`: 932
- `game_team_stats`: 1,864
- `game_player_stats`: 83,336

Latest snapshot reload preserved the LSU/Auburn validation facts:

- LSU 66, Auburn 0
- Houston Anderson: 508 passing yards, 7 TD
- Julian Reese II: 9 catches, 283 yards, 4 TD
