-
Notifications
You must be signed in to change notification settings - Fork 286
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
Libsql client: execute batch #607
Libsql client: execute batch #607
Conversation
08d8070
to
7d1d2d5
Compare
@Horusiath I think everyone agrees that rusqlite's batch API that accepts a single string is not the best match for us, so perhaps we should only add it as a compatibility layer? By that I mean:
Then we can get our users used to the "proper" API, and gradually deprecate the |
we already have |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM! Really nice work!
@@ -1,3 +1,5 @@ | |||
#![allow(dead_code)] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
When does this warning trigger? We could use cfg_attr
to only enable this in certain feature flag situations.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's mostly happening since I moved the parser.rs as an entire file, however in context of hrana we're only using a small subset of its functions.
pub(crate) ResultRows, | ||
pub(crate) usize, | ||
); | ||
pub(crate) struct RemoteRows(pub(crate) ResultRows, pub(crate) usize); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
is this rustfmt making this change? Seems odd since I should be running it on every save.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Apparently so. I have fmt running on every file save.
@psarna I think you're right, we should instead accept a |
and we already have a separate issue for it #562, lets do this in a follow up when we have time. |
Add support for executing batch statements (in rusqlite fashion) to libsql client: including Cloudflare compilation target.
There was a small mismatch in an API:
execute_batch(sql: &str)
: all statements are glued together into a single string.This means that we need to at least parse requests on the client side (which has its upsides and downsides), so I pulled sqlite3-parser out of the replication module and make it a dependency on hrana feature as well.
/cc @psarna @LucioFranco