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

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
sba-scout
rust
migration
phase-1
sqlx
sqlite
figment
decision
0.8 0.8 2026-02-27T01:18:18.061642+00:00 2026-02-27T01:19:08.017996+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

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