claude-memory/graph/decisions/sba-scout-rust-rewrite-phase-1-complete-foundation-layer-imp-c9add1.md
2026-02-27 23:06:41 -06:00

2.2 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
sba-scout
rust
migration
phase-1
sqlx
sqlite
figment
decision
0.8 0.8 2026-02-27T01:18:18.061642+00:00 2026-02-28T05:06:41.138617+00:00
target type direction strength edge_id
2cf3058c-85f4-481a-bbe7-17ebb9b9e908 BUILDS_ON outgoing 0.9 5cde624d-cbf0-456b-aa87-076e7e999dde
target type direction strength edge_id
c7aab060-25b8-4128-a661-eefad9dc4674 REQUIRES incoming 0.8 92d0e814-2cc0-4622-913c-8b92ad3f280d
target type direction strength edge_id
4dc83eed-b0b1-4924-b82e-faf352426785 FOLLOWS incoming 1.0 6dc75271-96a2-43f4-ad96-cfc26ce126c1
target type direction strength edge_id
0e484de1-cb92-479c-95ec-06fa9e886c0c FOLLOWS incoming 0.8 10efe7b8-fe41-4e80-8733-e65add502655

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): raw sqlx queries creating all 9 tables with proper constraints. Reviewer caught a missing UNIQUE constraint on lineups.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): figment crate used to load TOML config.
  • Added crates: csv, sha2, regex for 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, branch feat/rust-rewrite, subdir rust/
  • Language: Rust, async runtime: Tokio, DB: sqlx + SQLite