No such table
I've written a simple Workers script locally to get some data from D1
In wrangler.toml I bind it like this
In the Cloudflare Dashboard above I set up the database like this
I think the database should be fine, because I can access it using wrangler
But in the script I get this error
Did I make a mistake or something?
GitHub Issues link: https://github.com/cloudflare/workers-sdk/issues/3479
GitHub
๐ BUG: No such table ยท Issue #3479 ยท cloudflare/workers-sdk
Which Cloudflare product(s) does this pertain to? D1, Workers/Other, Wrangler What version of Wrangler are you using? 3.1.0 What operating system are you using? Windows 11 Describe the Bug I've...
5 Replies
Looks like remote vs local dev confusion
Wrangler 3.x defaults to local dev, if you want to use remote dev which uses the actual db, use wrangler dev --remote
If you want your wrangler D1 commands to effect the local dev db instead of remote, use --local, like
wrangler d1 execute <DATABASE_NAME> --local --command='SELECT * FROM Customers'
There's a helpful doc here that explains it all:
https://developers.cloudflare.com/d1/learning/local-development/
Local development ยท Cloudflare D1 docs
D1 has fully-featured support for local development, running the same version of D1 as Cloudflare runs globally. Local development uses Wrangler, the โฆ
I get this error with
wrangler dev --remote
is this a problem with my local network?
Possibly? That's interesting, there's a few mentions/issues with that on the workers sdk repo recently. Not something I've hit myself before, someone said it worked after a few retries, or you could try local dev
Ok thank you, I'll try a few more times later