If you have 4 indexes it will write 5 times (row + 4 indexes)
If you have 4 indexes it will write 5 times (row + 4 indexes)
wrangler d1 execute --local --file=.sql approach. I thought I could just move the .wrangler/state/v3/d1 dir over to another dir and spin things up but that did not work. Is there some other approach I could use?database_id & database_name?.sqlite file and run .dump.sqlite file, unless you are referring to a remote D1 Database?.sqlite file. D1 in local development is just a wrapper around that .sqlite file.wrangler directory?db.exec disabled inside pages functions? Works fine locally with wrangler, but not after deployed..exec, do you get a db.exec is not a function error? I'm getting that, wondering if it's the same thing you are seeing and if you found a workaround?D1Database.exec method.prepare() nd the migrator tries to use the base sqlite-core dialect, it uses transactions which aren't supported by d1 : https://github.com/drizzle-team/drizzle-orm/blob/main/drizzle-orm/src/sqlite-core/dialect.ts#L768-L812

D1's REST API doesn't involve a Worker, which is why it's considerably slower above in the chat. Oy vey.wrangler d1 execute --local --file=.sql.wrangler/state/v3/d1database_iddatabase_name.sqlite.sqlite.sqlite.sqlite.dump.wranglerdb.exec.execdb.exec is not a functionD1Database.exec.prepare()D1's REST API doesn't involve a Worker, which is why it's considerably slowerimport { json } from "@sveltejs/kit";
import { ACCOUNT_ID, CLOUDFLARE_API_KEY, CLOUDFLARE_EMAIL, DATABASE_ID } from '$lib/server/secrets.js';
/** @type {import('./$types').RequestHandler} */
export async function GET({ platform }) {
const url = `https://api.cloudflare.com/client/v4/accounts/${ACCOUNT_ID}/d1/database/${DATABASE_ID}/query`;
const options = {
method: 'POST',
headers: {
'Content-Type': 'application/json',
'X-Auth-Email': CLOUDFLARE_EMAIL,
'X-Auth-Key': CLOUDFLARE_API_KEY
},
body: '{"sql":"SELECT * from test"}'
};
const resp = await fetch(url, options);
const data = await resp.json();
return json(data);
}