wrangler --dev remote, or another namespace separate from your production namespace, but still deployed to cloudflares network?withSession yet, might just be coincidence, but I just deployed the worker with that change, and now the replicated D1 database is working just finewithSession()) all requests are sent to the primary explicitly. Under the hood the D1 binding has already been using the Sessions API for non replicated databases for months now, and it sends first-primary when you don't use withSession() yourself.withSession('first-unconstrained') which is working as I would expect, and not experiencing those same errorsD1_ERROR: Network connection lost. error. Sometimes after a few seconds, sometimes within a secondNetwork connection lost. are transient errors reaching the location/datacenter of your database.
first-unconstrained) just doing withSession()withSession('first-unconstrained') in dev, I decided to try and push that to prod. Now the database is entirely unresponsive and hasn't managed to serve a successful request for the last 10 minutes. Continually getting network connection lost errorsSessions API works with databases that do not have read replication enabled, so it is safe to run code with Sessions API even after disabling read replication.https://developers.cloudflare.com/d1/best-practices/read-replication/#benefits-of-read-replication
withSession() though, i'm not trying to use bookmarks on DBs that dont have replication enabled, so i cant confirm if that works or not. I imagine it would thoughwrangler.jsonc. I can successfully run the migrations if I do wrangler d1 migrations apply <database>, but when I then do wrangler pages dev --d1 MY_DB=mydb to run my app locally, drizzle complains about a missing table, seemingly my migrations haven't been run after all..sqlite files in .wrangler/state/v3/d1/miniflare-D1DatabaseObject migrations apply command operate on a different local database than wrangler pages dev? Just trying to figure out the best way to set this up, and feel like I'm using wrangler incorrectly herewrangler --dev remotewithSessionwithSession()withSession()withSession()withSession()first-primarywithSession('first-unconstrained')withSession('first-unconstrained')D1_ERROR: Network connection lost.Network connection lost.first-unconstrainedwrangler.jsoncwrangler d1 migrations apply <database>wrangler pages dev --d1 MY_DB=mydb.sqlite.wrangler/state/v3/d1/miniflare-D1DatabaseObjectmigrations apply