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

D1 batch helper #26

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open

Conversation

called-d
Copy link

  • I have verified my changes didn't break the example project.

Description

Cloudflare D1 doe's not support beginTransaction/commit/rollback. It supports batch statements and this is transaction.

Batched statements are SQL transactions. If a statement in the sequence fails, then an error is returned for that specific statement, and it aborts or rolls back the entire sequence.

I made helper function for batch statements.

  • cannot operate commit / rollback from application code
    • D1 is not exposed these operation.
  • cannot apply transformResult() of plugins
    • I can't get queryId from Compilable

@called-d
Copy link
Author

Kysely has no escape hatch.

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.

None yet

1 participant