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

Use Hrana 3 when available #68

Merged
merged 7 commits into from
Aug 23, 2023
Merged

Use Hrana 3 when available #68

merged 7 commits into from
Aug 23, 2023

Conversation

honzasp
Copy link
Contributor

@honzasp honzasp commented Aug 18, 2023

Upgrade to @libsql/hrana-client version 0.5 to transparently use Hrana 3 if the server supports it. This allows us to fix a hole in the transaction() and batch() APIs: previously, if the transaction was rolled back using ROLLBACK or using the OR ROLLBACK conflict resolution strategy, the following statements would be executed outside of a transaction. With Hrana 3, we can use hrana.BatchCond.isAutocommit() to fix this.

The Hrana client will also internally use cursors (streaming) to implement batches. This means that the server does not have load the full result set into memory before sending it, which reduces memory pressure. However, the client API is unchanged, so the client will still keep all results in memory.

@honzasp honzasp marked this pull request as ready for review August 23, 2023 11:46
@honzasp honzasp merged commit 00e9c9a into main Aug 23, 2023
3 checks passed
@honzasp honzasp deleted the hrana3 branch August 23, 2023 12: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.

1 participant