-
Notifications
You must be signed in to change notification settings - Fork 803
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
🐛 BUG: Invalid BEGIN TRANSACTION detection #5085
Comments
A workaround is to add a space between BEGIN and TRANSACTION, eg BEGIN TRANSACTION;
INSERT INTO "X" ("id", "text") VALUES (314, "Formerly know as Twitter");
# 101k insert statements
COMMIT; and run npx wrangler d1 execute musk-db --file=elon.sql |
NB: Transactions aren't currently supported yet, there is #2733 is implement this, however it is still open and in active discussion. This, on an initial glance, seems to be caused by workers-sdk/packages/wrangler/src/d1/trimmer.ts Lines 11 to 34 in 8d6d722
The I have raised #8412 to identify a potential fix - I most likely won't have free capcity to write tests to test this out in the near future, so if anyone's got any spare time feel free to take this draft PR as inspiration. |
Which Cloudflare product(s) does this pertain to?
D1, Wrangler core
What version(s) of the tool(s) are you using?
3.29.0 [wrangler]
What version of Node are you using?
v20.11.1
What operating system and version are you using?
Ubuntu 22.04.3 LTS
Describe the Bug
Observed behaviour
I tried to update a row in D1 by passing a string that contains the words BEGIN TRANSACTION utilising the Wrangler D1 command
execute
and got the error below.Expected behaviour
The row will be updated.
Steps to reproduce
wrangler.toml
is not relevant, since I am running a Wrangler command against D1, but here it is:Please provide a link to a minimal reproduction
No response
Please provide any relevant error logs
No response
The text was updated successfully, but these errors were encountered: