Skip to content

Expand FromRow tuple impls to 16 (currently capped at 4) #68

Description

@StefanSteiner

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

  • Extend the tuple impls up to 16-tuple, matching sqlx. Generate them via a declarative macro to keep the code compact.
  • Add a few sanity tests for 5/8/12/16-tuple cases against a real query.
  • Document the tuple-cap in the trait rustdoc.

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

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions