not authorized means you tried using a pragma/function that isn't allowlisted
not authorized means you tried using a pragma/function that isn't allowlisted
PRAGMA foreign_keys=OFF;D1’s foreign key enforcement is equivalent to SQLite’s PRAGMA foreign_keys = on directive. Because D1 runs every query inside an implicit transaction, user queries cannot change this during a query or migration.
defer_foreign_keys thoughBEGIN TRANSACTION; and COMMIT; as well. I'll review that allowlist. Thanks again, I've been able to import everything remotely now.
wrangler within a project, then calling it from there, so that you consitently use the same versionnpm doesn't actually support that for arbitrary commands, so npx would probably be the next best thing.pnpm for arbitrary command execution using the locally installed package: pnpm wrangler deploy [whatever]satisfies in your workers?request: Request, env: Envsatisfies ExportedHandler<Env> 
ExportedHandler : Promise<Response> for better DX, and then satisfies ExportedHandler<Env>;queue handlers don't need to return anything so: Promise<void> works wellsatisfies operatore introduced in TypeScript 4.9 shouldn't just check that the function matches expect class?batch is of type MessageBatch?ExportedHandler takes other generic types, included one for MessageBatchsatisfies covers most of the function. But the return type being explicit creates better errors for DX.npx wrangler deploy --dry-run --outdir=dist
⛅️ wrangler 3.57.0
-------------------
✘ [ERROR] Missing entry-point: The entry-point should be specified via the command line (e.g. `wrangler deploy path/to/script`) or the `main` config field.wrangler
Commands:
wrangler docs [command..] 📚 Open wrangler's docs in your browser
wrangler init [name] 📥 Initialize a basic Worker project, including a wrangler.toml file
wrangler generate [name] [template] ✨ Generate a new Worker project from an existing Worker template. See https://github.com/cloudflare/templates
wrangler dev [script] 👂 Start a local server for developing your worker
wrangler publish [script] 🆙 Publish your Worker to Cloudflare.
wrangler delete [script] 🗑 Delete your Worker from Cloudflare.
wrangler tail [worker] 🦚 Starts a log tailing session for a published Worker.
...elided...
wrangler login 🔓 Login to Cloudflare
wrangler logout 🚪 Logout from Cloudflare
wrangler whoami 🕵️ Retrieve your user info and test your auth config
wrangler types 📝 Generate types from bindings & module rules in config
wrangler deployments 🚢 List and view details for deployments
wrangler rollback [deployment-id] 🔙 Rollback a deployment
...npx wrangler --version
⛅️ wrangler 2.21.1 (update available 3.57.0)
-------------------------------------------------------
andrew@amackenz-mac collectr % wrangler --version
⛅️ wrangler 3.57.0
-------------------export default {
async fetch(request, env, ctx): Promise<Response> {
// do things
},
} satisfies ExportedHandler<Env>;