Skip to content

Conversation

@abonander
Copy link
Contributor

@abonander abonander commented Dec 12, 2025

Summary

closes #339

  • Adds Client::insert_formatted_with() and InsertFormatted for inserting data in a chosen format with a specified SQL query.

I decided to implement AsyncWrite instead of using async fns which should make this type easier to compose. For example, we can use tokio_util::io::SyncIoBridge to turn it into blocking I/O for the ADBC driver and directly wrap it in https://docs.rs/arrow-ipc/57.1.0/arrow_ipc/writer/struct.StreamWriter.html

Potential additions:

  • Client::insert_formatted(), taking a table name and format name
  • Method to directly send Bytes, bypassing buffer?
  • Rewrite Insert using this API

Delete items not relevant to your PR:

  • Unit and integration tests covering the common scenarios were added
  • A human-readable description of the changes was provided so that we can include it in CHANGELOG later

@mshustov mshustov requested review from serprex and slvrtrn December 15, 2025 13:04
/// Any other type of statement may produce incorrect results.
///
/// The statement is not issued until the first call to `.poll_write()`.
pub fn insert_formatted_with(
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

perhaps then we need to deprecate fetch_bytes, replacing it with fetch_formatted_with for consistency

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This could just be insert_bytes_with, I'm not particularly attached to the naming. I just tried to come up with something more descriptive.


/// Sets timeouts for different operations.
///
/// `send_timeout` restricts time on sending a data chunk to a socket.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

docs CI probably will complain about this without square brackets

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This was copied straight from Insert

@abonander abonander force-pushed the ab/insert-formatted branch 2 times, most recently from 77cfc36 to aa4b220 Compare December 19, 2025 03:11
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

Successfully merging this pull request may close these issues.

Insert data as raw bytes in chosen format

3 participants