Skip to content

fix(api): point query_as!/query_scalar! param comments at #137#153

Merged
StefanSteiner merged 2 commits into
tableau:mainfrom
StefanSteiner:ssteiner/query-as-param-binding-docs
Jun 16, 2026
Merged

fix(api): point query_as!/query_scalar! param comments at #137#153
StefanSteiner merged 2 commits into
tableau:mainfrom
StefanSteiner:ssteiner/query-as-param-binding-docs

Conversation

@StefanSteiner

Copy link
Copy Markdown
Contributor

Summary

Updates stale comments in query_as.rs that still reference "Milestone B (W3)"
and "a future milestone" — phrasing from the original compile-time validator
plan that predates the actual implementation (shipped in v0.4.0).

The query_as! / query_scalar! macros validate SQL and accept $N bind
arguments syntactically, but the runtime QueryAs<T> / QueryScalar<T> builders
don't actually bind them — params are stored as format!("{p:?}") debug strings
and the fetch_* methods forward to the non-param fetch_*_as. This is the
one remaining gap from the compile-time validator work.

Issue #137 (merged in #152) added fetch_one_as_params / fetch_all_as_params /
stream_as_params — exactly the runtime primitive needed to finish the binding.
These comments now point there so the connection isn't lost.

Changes

  • QueryAs::params comment: explains why it's dead + names fetch_*_as_params
    as the delegation target.
  • QueryAs::params #[allow(dead_code, reason = …)]: updated from stale
    "Milestone B (W3)" to "not yet wired — see issue Add parameterized FromRow methods (fetch_one_as/fetch_all_as/stream_as + ToSqlParam params) #137".
  • QueryAs::new doc: "typed binding will be tightened in W3" → points at the
    TODO(#137) on fetch_all.
  • QueryAs::fetch_all: added // TODO(#137) marking the exact forwarding site.
  • QueryScalar::params: added same-gap comment + aligned #[allow] reason
    string to match QueryAs.

Test plan

  • cargo clippy -p hyperdb-api --all-targets — clean (doc-only change)
  • cargo build --workspace — green

…au#137)

query_as! / query_scalar! validate SQL and accept $N args but the
QueryAs/QueryScalar runtime builders don't yet bind them (params stored
as debug strings; fetch_* forward to the non-param fetch_*_as). Point
the dead-code comment and a TODO at fetch_*_as_params (added in tableau#137) as
the primitive that finishes parameter binding.
Remove stale 'W3' and 'future milestone' phrasing from QueryAs::new doc
and QueryScalar::params allow-reason. Both now point at issue tableau#137 and
the _as_params delegation target, consistent with the QueryAs::params
comment updated in the prior commit.
@StefanSteiner StefanSteiner merged commit 926019d into tableau:main Jun 16, 2026
12 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant