Summary
The FromRow blanket tuple impls only cover 1, 2, 3, 4-tuples. Common Rust DB crates (sqlx, rusqlite, tokio-postgres) go to 12 or 16. Rows with more than four columns must define a hand-written struct + FromRow impl even when the user just wants ad-hoc destructuring.
Current state
$ grep -n "FromRow for (Option" hyperdb-api/src/result.rs | wc -l
3
Plus the 1-tuple impl at result.rs:758, giving four total — see result.rs:758-787.
Original gap analysis: §5 of docs/RUST_API_GAP_ANALYSIS.md (predecessor repo).
Proposed work
Backwards compatibility
Purely additive. Existing (Option<A>,) through (Option<A>, Option<B>, Option<C>, Option<D>) impls keep working unchanged.
Performance note
Pure type-system addition — zero runtime cost. Compile time grows slightly, but only for translation units that actually use the new arities.
Related
Summary
The
FromRowblanket tuple impls only cover 1, 2, 3, 4-tuples. Common Rust DB crates (sqlx,rusqlite,tokio-postgres) go to 12 or 16. Rows with more than four columns must define a hand-written struct +FromRowimpl even when the user just wants ad-hoc destructuring.Current state
Plus the 1-tuple impl at result.rs:758, giving four total — see result.rs:758-787.
Original gap analysis: §5 of
docs/RUST_API_GAP_ANALYSIS.md(predecessor repo).Proposed work
sqlx. Generate them via a declarative macro to keep the code compact.Backwards compatibility
Purely additive. Existing
(Option<A>,)through(Option<A>, Option<B>, Option<C>, Option<D>)impls keep working unchanged.Performance note
Pure type-system addition — zero runtime cost. Compile time grows slightly, but only for translation units that actually use the new arities.
Related
#[derive(FromRow)]reduces the demand for high-arity tuple impls (most users will reach for the derive instead). Tuple impls remain useful for ad-hoc destructuring without defining a struct.