Last active
September 4, 2023 12:35
-
-
Save mizchi/e26727dd195e175232e1153071650b26 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$ cat test.sql | |
select 1; | |
-- comment; | |
select 2;β | |
$ env WRANGLER_LOG=debug pnpm wrangler d1 execute mydb2 --file test.sql --batch-size 1 | |
-------------------- | |
π§ D1 is currently in open alpha and is not recommended for production data and traffic | |
π§ Please report any bugs to https://github.com/cloudflare/workers-sdk/issues/new/choose | |
π§ To request features, visit https://community.cloudflare.com/c/developers/d1 | |
π§ To give feedback, visit https://discord.gg/cloudflaredev | |
-------------------- | |
π Mapping SQL input into an array of statements | |
π Parsing 2 statements | |
π We are sending 2 batch(es) to D1 (limited to 1 statements per batch. Use --batch-size to override.) | |
β β οΈ Too much SQL to send at once, this execution will be sent as 2 batches. | |
βΉοΈ Each batch is sent individually and may leave your DB in an unexpected state if a later batch fails. | |
β οΈ Make sure you have a recent backup. Ok to proceed? β¦ yes | |
π Let's go | |
Retrieving cached values for account from node_modules/.cache/wrangler | |
π Executing on mydb2 (837018aa-cde8-49ce-ac2a-68225f45dea8): | |
select 1 | |
-- START CF API REQUEST: POST https://api.cloudflare.com/client/v4/accounts/f90b16619da21adbec058f5c09b1de53/d1/database/837018aa-cde8-49ce-ac2a-68225f45dea8/query | |
HEADERS: { | |
"Content-Type": "application/json", | |
"User-Agent": "wrangler/3.6.0" | |
} | |
INIT: { | |
"method": "POST", | |
"headers": { | |
"Content-Type": "application/json", | |
"User-Agent": "wrangler/3.6.0" | |
}, | |
"body": "{\"sql\":\"select 1\"}" | |
} | |
-- END CF API REQUEST | |
-- START CF API RESPONSE: OK 200 | |
HEADERS: { | |
"cf-cache-status": "DYNAMIC", | |
"cf-ray": "801643869a2f20a1-NRT", | |
"connection": "keep-alive", | |
"content-encoding": "gzip", | |
"content-type": "application/json; charset=UTF-8", | |
"date": "Mon, 04 Sep 2023 12:33:57 GMT", | |
"server": "cloudflare", | |
"set-cookie": "__cfruid=<masked> -1693830837; path=/; domain=.api.cloudflare.com; HttpOnly; Secure; SameSite=None", | |
"transfer-encoding": "chunked", | |
"vary": "Accept-Encoding", | |
"x-envoy-upstream-service-time": "495" | |
} | |
RESPONSE: { | |
"result": [ | |
{ | |
"results": [ | |
{ | |
"1": 1 | |
} | |
], | |
"success": true, | |
"meta": { | |
"served_by": "v3-prod", | |
"duration": 0.20614099875092504, | |
"changes": 0, | |
"last_row_id": 0, | |
"changed_db": false, | |
"size_after": 36864, | |
"rows_read": 0, | |
"rows_written": 0 | |
} | |
} | |
], | |
"success": true, | |
"errors": [], | |
"messages": [] | |
} | |
-- END CF API RESPONSE | |
π£ Executed 1 commands in 0.20614099875092504ms | |
-- comment; | |
select 2 | |
-- START CF API REQUEST: POST https://api.cloudflare.com/client/v4/accounts/f90b16619da21adbec058f5c09b1de53/d1/database/837018aa-cde8-49ce-ac2a-68225f45dea8/query | |
HEADERS: { | |
"Content-Type": "application/json", | |
"User-Agent": "wrangler/3.6.0" | |
} | |
INIT: { | |
"method": "POST", | |
"headers": { | |
"Content-Type": "application/json", | |
"User-Agent": "wrangler/3.6.0" | |
}, | |
"body": "{\"sql\":\"-- comment;\\nselect 2\"}" | |
} | |
-- END CF API REQUEST | |
-- START CF API RESPONSE: Internal Server Error 500 | |
HEADERS: { | |
"cf-cache-status": "DYNAMIC", | |
"cf-ray": "8016438bde7020a1-NRT", | |
"connection": "keep-alive", | |
"content-encoding": "gzip", | |
"content-type": "application/json; charset=UTF-8", | |
"date": "Mon, 04 Sep 2023 12:33:57 GMT", | |
"server": "cloudflare", | |
"set-cookie": "__cfruid=<masked>; path=/; domain=.api.cloudflare.com; HttpOnly; Secure; SameSite=None", | |
"transfer-encoding": "chunked", | |
"vary": "Accept-Encoding", | |
"x-envoy-upstream-service-time": "421" | |
} | |
RESPONSE: { | |
"result": [], | |
"success": false, | |
"errors": [ | |
{ | |
"code": 7500, | |
"message": "SQL code did not contain a statement." | |
} | |
], | |
"messages": [] | |
} | |
-- END CF API RESPONSE | |
β [ERROR] A request to the Cloudflare API (/accounts/f90b16619da21adbec058f5c09b1de53/d1/database/837018aa-cde8-49ce-ac2a-68225f45dea8/query) failed. | |
SQL code did not contain a statement. [code: 7500] | |
If you think this is a bug, please open an issue at: | |
https://github.com/cloudflare/workers-sdk/issues/new/choose |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment