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.4 KiB
2.4 KiB
| title | status | type | priority | created_at | updated_at |
|---|---|---|---|---|---|
| [TRIAGE] SQLx + workers-rs + Cloudflare D1 compatibility (known issues?) | completed | task | critical | 2026-03-10T23:32:11Z | 2026-03-10T23:32:11Z |
SQLx is fundamentally incompatible with Cloudflare Workers/D1. D1 is accessed through the
workers-rs JavaScript binding layer (worker::d1::D1Database), not a TCP connection.
SQLx requires a TCP-based connection and its compile-time query macros cannot run in the
Workers/WASM build environment.
Chosen architecture:
#[cfg(target_arch = "wasm32")]→ workers-rsD1Databasebindings (production)#[cfg(not(target_arch = "wasm32"))]→rusqlite+tokio-rusqlite(native dev/tests)
A QuoteRepository async trait provides a unified interface. Concrete type aliases
(AppRepo) avoid trait-object Send/Sync constraints in Axum handlers.
cargo test on the native host automatically selects the rusqlite path — no wrangler dev
or feature flags needed for integration tests.
The design doc's "Query layer: SQLx" is superseded. See implementation ticket 00aff0.
- Implementation ticket created: **00aff0** — full plan for Repository trait + D1/rusqlite impls. - Ticket a5049d (database connection module) updated — SQLx goal superseded. - Ticket 1f5bb5 (Cargo.toml) updated — cfg-split dependency constraints corrected. - Tickets a91260 and 2ab7a8 also resolved by this decision (see those tickets). `chore(quotesdb): resolve triage — sqlx-workersrs-cloudflare-d1-compatibility-known-issues`