```javascript const newUserId = await DB.prepare( ` INSERT INTO user (email, name) VAL
I removed the "BEGIN TRANSACTION" but still get this error locally:
A prepared SQL statement must contain only one statement.A prepared SQL statement must contain only one statement. const newUserId = await DB.prepare(
`
INSERT INTO user (email, name) VALUES (?,?);
SELECT last_insert_rowid() INTO @lastID;
INSERT INTO oauth_account (provider_id, provider_user_id, user_id) VALUES ("google", ?, @lastID);
SELECT @lastID;`,
)
.bind(email, name, provider_user_id)
.run();RETURNING * to get the id from an insert/updatereturning * to the end of an update/insert to be able to use it in a subsequent query, by itself it's not valid
wrangler d1 export on a newer version of wrangler and send them the sql?wrangler d1 list
✘ [ERROR] A request to the Cloudflare API (/accounts/xxxxx/d1/database) failed.
Authentication error [code: 10000]wrangler logout and wrangler login workedSuccessfully logged in.
✘ [ERROR] A request to the Cloudflare API (/accounts/xxxxx/d1/database) failed.
Authentication error [code: 10000]
Getting User settings...
👋 You are logged in with an OAuth Token, associated with the email xxxxxxx!
┌──────────────────────────────────────────┬──────────────────────────────────┐
│ Account Name │ Account ID │
├──────────────────────────────────────────┼──────────────────────────────────┤
│ xxxxxxx's Account │ xxxxxxx │
└──────────────────────────────────────────┴──────────────────────────────────┘
🔓 Token Permissions: If scopes are missing, you may need to logout and re-login.
Scope (Access)
- account (read)
- user (read)
- workers (write)
- workers_kv (write)
- workers_routes (write)
- workers_scripts (write)
- workers_tail (read)
- d1 (write)
- pages (write)
- zone (read)
- ssl_certs (write)
- constellation (write)
- ai (write)
- queues (write)
- offline_accessaccount_id in your Wrangler.toml?wrangler d1 list
✘ [ERROR] A request to the Cloudflare API (/accounts/xxxxx/d1/database) failed.
Authentication error [code: 10000]Successfully logged in.
✘ [ERROR] A request to the Cloudflare API (/accounts/xxxxx/d1/database) failed.
Authentication error [code: 10000]
Getting User settings...
👋 You are logged in with an OAuth Token, associated with the email xxxxxxx!
┌──────────────────────────────────────────┬──────────────────────────────────┐
│ Account Name │ Account ID │
├──────────────────────────────────────────┼──────────────────────────────────┤
│ xxxxxxx's Account │ xxxxxxx │
└──────────────────────────────────────────┴──────────────────────────────────┘
🔓 Token Permissions: If scopes are missing, you may need to logout and re-login.
Scope (Access)
- account (read)
- user (read)
- workers (write)
- workers_kv (write)
- workers_routes (write)
- workers_scripts (write)
- workers_tail (read)
- d1 (write)
- pages (write)
- zone (read)
- ssl_certs (write)
- constellation (write)
- ai (write)
- queues (write)
- offline_accessRETURNING *returning *✘ [ERROR] A request to the Cloudflare API (/accounts/67d05e471e1ffe25b7ba89dc94d53c1e/d1/database/7daadf1d-3893-420b-a61f-e77cc2963a0e/time_travel/restore?bookmark=0000050f-00000004-00004d9e-8e5306bc9a4d7f84b25d329535288b3f) failed.
The destination execution context for this RPC was canceled while the call was still running.
[code: 7500]const newUser = await DB.prepare(
`INSERT INTO user (email, name) VALUES (?,?);
RETURNING *;
INSERT INTO oauth_account (provider_id, provider_user_id, user_id) VALUES ('google', ?, @lastID)`
)
.bind(email, name, provider_user_id)
.run();