You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
2.8 KiB
2.8 KiB
| title | status | type | priority | created_at | updated_at |
|---|---|---|---|---|---|
| [TRIAGE] Local dev config: Turso (file SQLite) vs D1 binding selection strategy | completed | task | critical | 2026-03-10T23:32:06Z | 2026-03-10T23:32:06Z |
This decision is a direct consequence of TRIAGE e8a330 (already resolved): SQLx is NOT compatible
with Cloudflare Workers/D1 at all. The chosen architecture is cfg(target_arch = "wasm32") compile-time split:
wasm32(production) → workers-rsD1Databasebindings- native (local dev + tests) →
rusqlite+tokio-rusqlitewith a local.sqlitefile
Rationale for rusqlite over Turso:
- No additional dependency or service (Turso = libsql client + server/cloud)
rusqlitewithfeatures = ["bundled"]compiles SQLite in — zero system dependenciescargo runjust works without any account, credentials, or external toolingcargo testworks the same way — tests use the rusqlite path automatically
Rationale for rusqlite over wrangler D1 local:
- No wrangler, no Cloudflare account required for local dev or CI
- Eliminates a major developer friction point
- Integration tests use
NativeRepository(rusqlite) directly without spawning wrangler
Selection mechanism: compile-time via cfg(target_arch = "wasm32"), not runtime env var.
The DATABASE_URL env var controls the SQLite file path (default: ./quotesdb.sqlite).
Port note: Native API server binds to localhost:3000 (Trunk UI dev server uses localhost:8080).
Port conflict found and fixed in ticket 00aff0 (was 8080, corrected to 3000).
Updated:
- Ticket 00aff0 (DB abstraction): corrected native server port 8080 → 3000
- Ticket af56a7 (local dev docs): updated title and body to reflect rusqlite approach
- Ticket 9c9546 (new): create
.env.exampledocumentingDATABASE_URL