Minor Changes
-
#14089
c6c61b5Thanks @alsuren! - Addmigrations_patternto D1 database bindingsThe D1 binding now accepts an optional
migrations_patternfield, allowing you to pointwrangler d1 migrations applyandwrangler d1 migrations listat migration files in nested layouts (e.g. ORM-generated folders likemigrations/0000_init/migration.sql).migrations_patternis a glob (relative to the wrangler config file) and defaults to${migrations_dir}/*.sql, which preserves today's behaviour. Files that do not match the pattern are not executed.When no migrations match the configured pattern but files matching the common
migrations/*/migration.sql(drizzle-style) layout do exist, Wrangler logs a hint suggestingmigrations_patternas an opt-in.wrangler d1 migrations createnow returns an actionable error if the generated migration filename would not match the configured pattern. -
#14164
b502d54Thanks @G4brym! - Rename theweb_searchbinding kind towebsearchPre-launch rename of the public binding type from
web_searchtowebsearchso the on-the-wire shape matches the product name (Web Search). The wrangler config key, the binding-type string sent to the Cloudflare API, and the miniflare option key all move fromweb_search/webSearchtowebsearch.Update your wrangler config:
- "web_search": { "binding": "WEBSEARCH" } + "websearch": { "binding": "WEBSEARCH" }
The runtime
WebSearchtype exposed onenv.WEBSEARCHis unchanged. -
#14146
c4f45e8Thanks @dario-piotrowicz! - SimplifyconstructWranglerConfigto accept a single worker instead of an arrayThe
constructWranglerConfigfunction now accepts a singleAPIWorkerConfigobject instead ofAPIWorkerConfig | APIWorkerConfig[]. The multi-environment array support has been removed since the array use-case was removed and now the only call site already passes a single worker object. This is a breaking change to the function's public signature.
{ "d1_databases": [ { "binding": "DB", "database_name": "my-db", "database_id": "...", "migrations_dir": "migrations", "migrations_pattern": "migrations/*/migration.sql" } ] }