Implement query with interpolation flags#259
Implement query with interpolation flags#259ozgurcancal wants to merge 1 commit intoClickHouse:mainfrom
Conversation
| eprintln!( | ||
| "warning use QI::BIND template flag,bind() skipped for query: {}", | ||
| self | ||
| ); |
There was a problem hiding this comment.
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.
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.
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.
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