store: Rust CSV importer integration tested — matches Python DB exactly

This commit is contained in:
Cal Corum 2026-02-28 12:09:42 -06:00
parent 9fddb71183
commit bafb720731

View File

@ -0,0 +1,39 @@
---
id: ad48fe50-12a6-4c65-a49c-3a691d75e03f
type: solution
title: "Rust CSV importer integration tested — matches Python DB exactly"
tags: [sba-scout, rust, importer, csv, testing, integration-test]
importance: 0.7
confidence: 0.8
created: "2026-02-28T18:09:42.807948+00:00"
updated: "2026-02-28T18:09:42.807948+00:00"
---
# Rust CSV importer integration tested — matches Python DB exactly
## Context
The Rust CSV card importer (`api/importer.rs`) had unit tests for parse helpers but no integration test against real CSV data. The Rust DB previously had 0 cards because the importer had never been run against actual files.
## Test Run
1. Copied `BatterCalcs.csv` and `PitcherCalcs.csv` to `rust/docs/sheets_export/`
2. Ran `import_all_cards()` against the Rust DB (`rust/data/sba_scout.db`)
## Results
| Type | Cards Imported | Errors |
|---------|---------------|--------|
| Batter | 490 | 0 |
| Pitcher | 502 | 0 |
Identical to Python DB row counts. Sample values verified (Rutschman batter card, Ben Brown pitcher card).
## Committed
CSVs committed to repo at `rust/docs/sheets_export/`.
## Key Notes
- Default CSV paths are relative to `rust/` cwd: `docs/sheets_export/BatterCalcs.csv` and `docs/sheets_export/PitcherCalcs.csv`
- The Rust app uses `rust/data/sba_scout.db` (separate from Python's `data/sba_scout.db`)