Skip to content

Commit

Permalink
feat: Add D1 binding support to Email Workers (#2878)
Browse files Browse the repository at this point in the history
  • Loading branch information
rozenmd committed Mar 8, 2023
1 parent b0d10ab commit 6ebb23d
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 0 deletions.
9 changes: 9 additions & 0 deletions .changeset/spotty-walls-crash.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
---
"wrangler": patch
---

feat: Add D1 binding support to Email Workers

This PR makes it possible to query D1 from an Email Worker, assuming a binding has been setup.

As D1 is in alpha and not considered "production-ready", this changeset is a patch, rather than a minor bump to wrangler.
3 changes: 3 additions & 0 deletions packages/wrangler/templates/d1-beta-facade.js
Original file line number Diff line number Diff line change
Expand Up @@ -237,5 +237,8 @@ var shim_default = {
async trace(traces, env, ctx) {
return worker.trace(traces, getMaskedEnv(env), ctx);
},
async email(message, env, ctx) {
return worker.email(message, getMaskedEnv(env), ctx);
},
};
export { shim_default as default };

0 comments on commit 6ebb23d

Please sign in to comment.