I was trying out the d1 get started guide and the first command to create a d1 project doesn't work. I tried using npm and it throw a 404 Error. I tried using npx also but a similar error happened, although a little bit different as you can see on the terminal. I tried installing create-cloudfare and it also didn't work. What do I need to do to make it work?
Hey i have db per user case, and now i need to check it with cron if a user have some event scheduled to do some processing and send emails. Is there any smart way of querying all databases at once?
Lighter Prisma is in the works. The Kysely gap you described is solvable today-ish with plugins, and possibly in the future with some new APIs (but without turning the library into yet another ORM.)
Hey all I'm a massive Cloudflare advocate in my big organization, and we use it heavily. So far we haven't been using D1 as we have no need. But I've started using it on a side passion project of my own. So far everything works how I would like it, except that the Response time for basically any query (even the most simple ones) are very high.
I have a worker which serves as my API layer, and it calls the D1 internally. Every request takes over 2-3 sec to respond.
What is your experience with D1 response times?
Also to mention, the DB is very small ~12kb in total.
That seems to align with what others are reporting, depending on network latency, types of queries, db location, etc. I would be wary of using D1 in production though until there's some more guidance around error rates and types of errors, since they do seem to happen more than would be reasonably expected: https://github.com/cloudflare/cloudflare-docs/issues/18485
Interesting. I've just joined Disc here, and I'm reading through history, where I'm seeing people having the same problem I'm having. @James do you have some recommendation on what works well as a simple DB together with Workers?
I'd go with Postgres via https://neon.tech/ if you want something more featured than SQLite - you can pair it with Hyperdrive for some impressive latency/query times, or https://turso.tech/ if you want SQLite which I've heard good things about
Ok great, I will try it out. I might go with SQLite first as I've already built most of the queries/seeds etc. And I really need the most basic of stuff. I appreciate the recommendations.
I previously used raw SQL and I moved to Drizzle. I still try to use Drizzle as close to raw SQL as I can (I use the query builder not their db.querydb.query wrapper) but IMO it's very handy to be able to construct SQL with standard JS/TS functions rather than string interpolation.