can I have a look at the toml file also

can I have a look at the toml file? also, are you using pages or workers?
22 Replies
andyt
andyt•8mo ago
pages
Paolo of Lost Pages
Paolo of Lost Pages•8mo ago
have you set up preview_database_id = "DB" in the environment you use for local?
andyt
andyt•8mo ago
no
Paolo of Lost Pages
Paolo of Lost Pages•8mo ago
also how do you run it? because this is mone
andyt
andyt•8mo ago
wrangler pages dev --compatibility-date=2023-01-01 ./pages --kv=KV --d1=DB
Paolo of Lost Pages
Paolo of Lost Pages•8mo ago
please do not share database IDs 😄
andyt
andyt•8mo ago
theres nothing in it of value anyway
Paolo of Lost Pages
Paolo of Lost Pages•8mo ago
yeah but people peeking at schemas might reveal flaws this is mine
andyt
andyt•8mo ago
I just wanna be able to dev locally, or I'll use another db
Paolo of Lost Pages
Paolo of Lost Pages•8mo ago
[env.production] kv_namespaces =[ { binding = "SESSION_KV", id = "xxxxxxxxxx" } ] d1_databases = [ {binding = "DB", database_name = "nekotest",database_id = "xxxxxxxxxx" }] [env.preview] kv_namespaces =[ { binding = "SESSION_KV", id = "xxxxxxxxxx" } ] d1_databases = [ {binding = "DB", database_name = "nekotest-preview", database_id = "xxxxxxxxxx", preview_database_id = "DB" }] It needed preview_database_id to work
kian
kian•8mo ago
Pages doesn't use Wrangler.toml - it's all done by CLI flags on pages dev
Paolo of Lost Pages
Paolo of Lost Pages•8mo ago
ok, then that must have been completely ineffective black magic
andyt
andyt•8mo ago
so this toml isnt doing anything?
Paolo of Lost Pages
Paolo of Lost Pages•8mo ago
well, it is used by wrangler migrations
andyt
andyt•8mo ago
i can see the sqlite files, I assume I have multiple local databases in use, can I purge these and recreate from my remote? i assume thats what the migration should do
Paolo of Lost Pages
Paolo of Lost Pages•8mo ago
you can totally remove the directory and migrate again
andyt
andyt•8mo ago
if I try to migrate my database it cant find it locally, I am not passing --local the rest of the api suggests these calls are remote unless you pass --local also I assume I need the wrangle file if I am using wrangle in my project ah ok, so a migration assumes the changes are local and can be pushed to remotely, which makes sense thanks @Lost Pages it mentions here preview_database_id is required for pages local development
Paolo of Lost Pages
Paolo of Lost Pages•8mo ago
woot!
andyt
andyt•8mo ago
daily reminder the devil is still in fact in the detail
Paolo of Lost Pages
Paolo of Lost Pages•8mo ago
my understanding is that at some point pages will use wrangler.toml to set up things in prod, but wrangler locally uses it now to do migrations and there is no complete example with separate environments and preview_database_id so it took me time and i'm old
andyt
andyt•8mo ago
yeah the docs are not clear on the local dev part, thanks for your help
Paolo of Lost Pages
Paolo of Lost Pages•8mo ago
I'm glad it worked! migrations still user wrangler.toml, so if you use migrations you still need it
Want results from more Discord servers?
Add your server
More Posts
Dashboard UI BugNot the biggest deal, but the icon color for D1 on the Workers pricing page has been broken for awhiIf I called waitUntil(callback()) in a loop just say loop length is 100, so does that mean the...?If I called waitUntil(callback()) in a loop just say loop length is 100, so does that mean the callbPipeing cfssl bundle into cfssljson fails with 'Request failed:'when i run```bash $ cfssl bundle -ca-bundle=root.pem -int-bundle=intermediate.pem -cert=admin.pem | Pages and Strong ETagsDoes Pages automatically generate strong ETags that we can configure as an Enterprise customer? We hIssue with DO connected to worker incrementally increasing on every executioncan someone take a look at this issue and help us figure out what is wrong? - when we call the wateI'm struggling with wrangler OAuth authentication on macOS (m1 Sonoma)I'm attempting to setup a new worker on my m1 mac (I haven't set one up on this machine before). As Cloudflare load balancer using gRPC terminates after 10 minutesI have a load balancer setup for my gRPC service. It works pretty well, except for two issues that mI am getting connection limited even tho i've only done half of my available subrequestsI have a cronjob that runs every 5 minutes, it does 22 subrequests and then a D1 batch, but for someSSL not being updatedI disabled the DNS for one of my subdomains and then created a R3 SSL, but it continues to apper usiIntercepting routesare intercepting routes supported? https://nextjs.org/docs/app/building-your-application/routing/int