1.9 KiB
1.9 KiB
| id | type | title | tags | importance | confidence | created | updated | relations | ||||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| c9add129-283a-445a-8dff-4525ec7fa9b6 | decision | SBA Scout Rust rewrite Phase 1 complete — foundation layer implemented |
|
0.8 | 0.8 | 2026-02-27T01:18:18.061642+00:00 | 2026-02-27T01:19:08.017996+00:00 |
|
SBA Scout Rust Rewrite — Phase 1 Foundation Complete
Status
Phase 1 (Foundation) committed as 2005307 on branch feat/rust-rewrite.
What Was Implemented
- Schema creation (
schema.rs): rawsqlxqueries creating all 9 tables with proper constraints. Reviewer caught a missingUNIQUEconstraint onlineups.name— fixed before commit. - Query functions (
queries.rs): 20 async query functions covering teams, players, cards, lineups, sync status, matchup cache, and roster aggregates. - Config integration (
main.rs/app.rs):figmentcrate used to load TOML config. - Added crates:
csv,sha2,regexfor later phases.
Key Architectural Decisions
| Decision | Rationale |
|---|---|
| No ORM — sqlx pool directly | Avoid session pattern complexity; sqlx macros give compile-time query checking |
| Separate queries for player + cards (not JOINs) | Simpler, more composable; avoids N+1 differently |
ON CONFLICT for upserts |
SQLite idiomatic upsert pattern |
| TOML config (not YAML) | Python side uses YAML but Rust ecosystem prefers TOML; figment handles both |
Repository
- Repo:
sba-scouting, branchfeat/rust-rewrite, subdirrust/ - Language: Rust, async runtime: Tokio, DB: sqlx + SQLite