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

Support for async insert #65

Closed
magurotuna opened this issue May 21, 2023 · 6 comments
Closed

Support for async insert #65

magurotuna opened this issue May 21, 2023 · 6 comments

Comments

@magurotuna
Copy link

Hi, thanks for the effort to make clickhouse accessible from Rust!
It would be even greater to have a support for async insert when inserting records with this crate.

@magurotuna
Copy link
Author

@makorne Just to clarify, does your query work fine with non-async inserts?

@makorne
Copy link

makorne commented May 23, 2023

Looks like it is my bad, I forgot to add :
#[serde(with = "serde_bytes")] for Vec<u8>,
Now will check.
Thank you for prompt answer!

@makorne
Copy link

makorne commented May 23, 2023

@makorne Just to clarify, does your query work fine with non-async inserts?

Issue solved only after return on non-async inserts.
No BadResponse at all now.
Although them was a lot even after #[serde(with = "serde_bytes")] for Vec<u8>,

@magurotuna
Copy link
Author

I figured out that a field of type Datetime failed to be inserted because of the following error.

thread 'async_insert' panicked at 'called `Result::unwrap()` on an `Err` value: BadResponse("Code: 33. DB::Exception: Cannot read all data. Bytes read: 17. Bytes expected: 111.: (at row 105)\n: While executing BinaryRowInputFormat. (CANNOT_READ_ALL_DATA) (version 23.4.2.11 (official build))")', tests/test_query.rs:106:24

Now this issue has been fixed in the pull request

@makorne
Copy link

makorne commented May 30, 2023

Now this issue has been fixed in the pull request

I test it now.
Looks - No BadResponse!!!

The perfect shot!

@slvrtrn
Copy link
Contributor

slvrtrn commented Aug 7, 2024

Closing this, as async_insert is already supported via the client options. See this example on the main branch.
Additionally, after #123, it will be possible to use .with_option not only with the Client instance but also with insert/inserter for a particular statement only (see the not yet merged example from the branch).

@slvrtrn slvrtrn closed this as not planned Won't fix, can't repro, duplicate, stale Aug 7, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants