-
Notifications
You must be signed in to change notification settings - Fork 98
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
Support server-side parameter binding #142
Labels
enhancement
New feature or request
Comments
1 task
what about client
.query("SELECT plus({val1: Int32}, {val2: Int32}) AS result")
.with_param("val1", 42)
.with_param("val2", 144)
.fetch_one::<i32>()
.await?; |
It actually works now as: use clickhouse::{error::Result, Client};
#[tokio::main]
async fn main() -> Result<()> {
let client = Client::default()
.with_url("http://localhost:8123");
let result = client
.query("SELECT plus({val1: Int32}, {val2: Int32}) AS result")
.with_option("param_val1", "42")
.with_option("param_val2", "144")
.fetch_one::<u64>()
.await?;
println!("Result: {result:?}");
Ok(())
} But the user has to (properly) serialize the values on the application side. |
Can create generic method over serializable types |
serprex
added a commit
that referenced
this issue
Sep 24, 2024
serprex
added a commit
that referenced
this issue
Sep 24, 2024
serprex
added a commit
that referenced
this issue
Sep 24, 2024
serprex
added a commit
that referenced
this issue
Sep 24, 2024
serprex
added a commit
that referenced
this issue
Sep 24, 2024
Merged
serprex
added a commit
that referenced
this issue
Sep 24, 2024
serprex
added a commit
that referenced
this issue
Sep 24, 2024
serprex
added a commit
that referenced
this issue
Oct 2, 2024
serprex
added a commit
that referenced
this issue
Oct 2, 2024
serprex
added a commit
that referenced
this issue
Oct 2, 2024
serprex
added a commit
that referenced
this issue
Oct 2, 2024
serprex
added a commit
that referenced
this issue
Nov 7, 2024
serprex
added a commit
that referenced
this issue
Nov 19, 2024
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
See the docs.
For example:
We already have
.bind
, though, for client-side substitutions; so maybe it can be done asTheoretically, we can even do something like this as well:
The text was updated successfully, but these errors were encountered: