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

libsql/core: Add Connection::last_insert_rowid() to V2 #307

Merged
merged 1 commit into from
Aug 24, 2023

Conversation

penberg
Copy link
Collaborator

@penberg penberg commented Aug 24, 2023

No description provided.

@penberg penberg requested a review from LucioFranco August 24, 2023 08:37
@penberg penberg added this pull request to the merge queue Aug 24, 2023
Merged via the queue into main with commit d6a3dc5 Aug 24, 2023
@penberg penberg deleted the last-insert-rowid-v2 branch August 24, 2023 09:05
MarinPostma added a commit that referenced this pull request Oct 17, 2023
307: sqld programs r=MarinPostma a=MarinPostma

This PR implements sqld programs on the model of hrana programs.

Programs take over batches in the execution of queries within sqld, since they are very flexible and let the `Database` API consumer specify how statements should be executed.

The API of the sqld programs closely matches that of hrana batches, so the implementation on hrana side is changed to simply transform a hrana batch into a sqld program.

On the HTTP side, batches of queries are transformed into a program that causes a rollback if any statement in the batch fails.

On the replica, the programs are serialized and sent over by gRPC to the primary when we detect that they could cause a write. 

This PR also solves a known bug in HTTP batches that used to unconditionally execute statements in a batch even if a statement in the batch failed, and never rolledback, since the new implementation of HTTP batches ensures that a rollback is always performed if any statement in the batch fails to execute.

Future work: expose a more direct access to the `Database` to the consumers

Co-authored-by: ad hoc <[email protected]>
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