Hey im getting this error 'binding DB of type d1 must have a valid `id` specified [code: 10021]' whe

Hey im getting this error 'binding DB of type d1 must have a valid id specified [code: 10021]' when trying to run wrangler dev --remote, I have my binding setup with a preview_database_id as well!?
19 Replies
Max (@rozenmd)
Max (@rozenmd)13mo ago
D1 storage operation exceeded timeout which caused object to be reset fires when a query takes too long to run (which I believe is 30 seconds, let me double check that) - adding an index to your query should help bring it down
Unknown User
Unknown User13mo ago
Message Not Public
Sign In & Join Server To View
Max (@rozenmd)
Max (@rozenmd)13mo ago
Not yet, but we recommend https://github.com/nora-soderlund/cloudflare-d1-backups while we build a way to do it natively
Unknown User
Unknown User13mo ago
Message Not Public
Sign In & Join Server To View
Max (@rozenmd)
Max (@rozenmd)13mo ago
this is explicitly for dumping D1's beta databases - alpha databases could be exported as sqlite binaries and dumped to SQL manually
Unknown User
Unknown User13mo ago
Message Not Public
Sign In & Join Server To View
thiccvitalik
thiccvitalik13mo ago
But the whole migration is still executed in a transaction, right? From the SQLite docs: "It is not possible to enable or disable foreign key constraints in the middle of a multi-statement transaction (when SQLite is not in autocommit mode). Attempting to do so does not return an error; it simply has no effect." - https://www.sqlite.org/foreignkeys.html
Lu
Lu13mo ago
So in terms of achieving better latency around the globe, using planet scale is better in the meantime as an alternative
roccho
roccho13mo ago
I want to ask about design. Anyone separates two endpoints like these: * from d1 to durable objects * from durable objects to response The advantage of this design may be composability of DO. Any thoughts?
roccho
roccho13mo ago
No description
Hello, I’m Allie!
What would the DO be doing in this case that you couldn't do Worker -> D1?
Max (@rozenmd)
Max (@rozenmd)13mo ago
What are you building?
roccho
roccho13mo ago
@HardlyHolidayin’ @rozenmd Some reason like these: Still don't know the cost of d1 only one DO but can hav a memory instance and avoid making demands on the physical store assuming the team can't write sql There's nothing we can't do with D1. Should I have asked this question here?
Cyb3r-Jak3
Cyb3r-Jak313mo ago
Pricing · Cloudflare D1 docs
D1 is currently free to use during the public beta. Billing is expected to be enabled on December 1st, 2023 for developers using D1 on the Workers …
Sefirost
Sefirost13mo ago
Hi! I am measuring calls to D1 from a worker and a simple select from a table with 1 record is taking around 280ms while in dashboard metrics the latency reported is 0-1ms. -Is there a way to improve it? -Is this because it is still on beta? -Could it be worker execution region is diferent to d1 region (I am in south america)? I used automatic region setup on D1 creation but I am not able to see where it was placed.
Max (@rozenmd)
Max (@rozenmd)13mo ago
Latency in the dashboard metrics is a measure of how long D1 took to run the query, 280ms sounds like how long it takes to run the query + get the result back to you Read replication should help once it gets released Could be - you can run npx wrangler d1 info <dbname> to see where your db is running
Sefirost
Sefirost13mo ago
Thanks! It seems my D1 is runnig on Eastern North America, so it makes sense that latency. Will read replication support replication in South America?
No description
Max (@rozenmd)
Max (@rozenmd)13mo ago
the issue is Durable Object support in South America, which (as far as I understand) is coming soontm
Sefirost
Sefirost13mo ago
Great news! 👏 Thanks again
Want results from more Discord servers?
Add your server