-
Notifications
You must be signed in to change notification settings - Fork 134
Implement query with interpolation flags #259
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
eprintln!( | ||
"warning use QI::BIND template flag,bind() skipped for query: {}", | ||
self | ||
); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's better to use the log crate here.
eprintln!( | |
"warning use QI::BIND template flag,bind() skipped for query: {}", | |
self | |
); | |
log::warn!("use QI::BIND template flag,bind() skipped for query: {self}"); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks, This is the default macro stated in the macros.rs
#[must_use] | ||
#[derive(Clone)] | ||
pub struct Query { | ||
pub struct Query<const INTERPFLAGS: u8 = { QI::DEFAULT }> { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Changing a public type should be a major version bump.
Can this be avoided, by the way? What is the purpose of having INTERPFLAGS
here instead of a regular setter?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for your comment. I think discouraging unconscious use of bind or fields function should be query wise. Otherwise, it would appear less intuitive and introduce unnecessary complexity, since these functions are commonly used with both execute and fetch.
Therefore, handling interpolation only in fetch would not be sufficient. If fetch were the only place where interpolation was needed, I would simply enable all flags (including bind and fields) and update the interpolation state directly via the fetch function template argument.
9b8aa48
to
911124d
Compare
Summary
Add support for explicit interpolation flags to specify exactly which interpolation features should be enabled in the query.
Add integration tests for possible flag combinations.
Update README.
Reference: #157