how to use d1 procedures with Pages

https://blog.cloudflare.com/whats-new-with-d1/
[[ d1_databases ]]
# What binding name to use (e.g. env.DB):
binding = "DB"
# The name of the DB (used for wrangler d1 commands):
database_name = "my-d1-database"
# The D1's ID for deployment:
database_id = "48a4224e-...3b09"
# Which D1 to use for `wrangler dev`:
# (can be the same as the previous line)
preview_database_id = "48a4224e-...3b09"

# NEW: adding "procedures", pointing to a new JS file:
procedures = "./src/db/procedures.js"
[[ d1_databases ]]
# What binding name to use (e.g. env.DB):
binding = "DB"
# The name of the DB (used for wrangler d1 commands):
database_name = "my-d1-database"
# The D1's ID for deployment:
database_id = "48a4224e-...3b09"
# Which D1 to use for `wrangler dev`:
# (can be the same as the previous line)
preview_database_id = "48a4224e-...3b09"

# NEW: adding "procedures", pointing to a new JS file:
procedures = "./src/db/procedures.js"
however pages does not need a wrangler.toml config.
The Cloudflare Blog
D1: our quest to simplify databases
Get an inside look on the D1 experience today, what the team is currently working on and what’s coming up!
No description
3 Replies
Cyb3r-Jak3
Cyb3r-Jak39mo ago
You can see use the wrangler.toml file for D1 commands just means when you publish your pages project the bindings aren't set.
TigersWay
TigersWay9mo ago
@Cyb3r-Jok3 Which basically - again - means that Pages Functions are not in par with Workers :facesad:
Walshy
Walshy9mo ago
Procedures are not available to either They aren't actually released, the blog talks about what the team were thinking at the time
Want results from more Discord servers?
Add your server