Skip to content
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

GetHandler returns from Pool.get_handle() is not a future for await oper, tokio 1.33 #201

Open
zhugf opened this issue Oct 25, 2023 · 1 comment

Comments

@zhugf
Copy link

zhugf commented Oct 25, 2023

The GetHandle struct that returns from Pool.get_handle() can't use with await :
---- packages ----
[dependencies]
tokio = { version = "1", features = ["full"] }
clickhouse-rs="*"
....
Compiling clickhouse-rs v0.1.21
Compiling tokio v1.33.0
---- code ----
use clickhouse_rs::{Pool, types::Block};
use std::error::Error;
use tokio;

#[tokio::main]
async fn main() -> Result<(), Box> {
let database_url = "";
let pool = Pool::new(database_url);
let mut client = pool.get_handle().await?;
Ok(())
}
---- error message ----
error[E0277]: GetHandle is not a future
--> src/main.rs:9:40
|
9 | let mut client = pool.get_handle().await?;
| -^^^^^
| ||
| |GetHandle is not a future
| help: remove the .await
|
= help: the trait Future is not implemented for GetHandle
= note: GetHandle must be a future or must implement IntoFuture to be awaited
= note: required for GetHandle to implement IntoFuture

For more information about this error, try rustc --explain E0277.
warning: clickhouse-test (bin "clickhouse-test") generated 1 warning
error: could not compile clickhouse-test (bin "clickhouse-test") due to previous error; 1 warning emitted

@suharev7
Copy link
Owner

The 1.1.0-alpha.1 version is needed.

clickhouse-rs = "1.1.0-alpha.1"

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

No branches or pull requests

2 participants