Update db-sqlite
to support Cloudflare D1
#8962
sorodrigo
started this conversation in
Feature Requests & Ideas
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Now that Cloudflare supports
node-js
runtime, I was able to deploy thepayload@beta
in cloudflare workers.I started having issues with connecting to mongo because mongoose doesn't run on CF workers. I could use postgres with CF Hyperdrive but I figured that for this app I could use a smaller db so SQLite is an option.
I was investigating what would it take to connect it to CF D1 db and it seems pretty straightforward. Only change we need to do is update the types and the connect method of the
@payload/db-sqlite
package to support passing a D1 instance from the config. And then instantiate drizzle using theD1
driver.I already created a fork and I'm testing out this solution. Would be good to have it natively in the library.
What do y'all think? I think this could be pretty dope, PayloadCMS on the edge!
Beta Was this translation helpful? Give feedback.
All reactions