romeerez/orchid-orm

any plans for supporting serverless support ?

Opened this issue · 2 comments

i am trying to deploy my backend API with orchid to cloudflare workers, but i am getting some error, because of some library,

are there any plans for providing serverless support?

if yes, would like to contribute!

error:

image

The plans totally depend on users (and a bit on my enthusiasm for implementing specific things), so since you want to have it, it definitely won't be quick to support this, but I'll look into it and will try to do what's possible.

The warning on your screenshot says "enable the "nodejs_compat" compatibility flag", add this to wrangler.toml (from docs):

node_compat = true

Of course, something else is going to fail then.

I'd suggest Drizzle or Kysely for serverless because Drizzle is specially designed and optimized for serverless, and Kysely is lightweight by nature (not an ORM). For serveless, and for edge computing especially, it's important to use lightweight libraries, or even writing raw SQL, because it's very limited by memory and response ms.

I expect this to take a lot of time to optimize OrchidORM bundle sizes, to make it more modular and to allow loading only those modules that you need. For example, there is a module for full text search, you probably don't need it, and for serverless it's important to load only what you're going to use.

So, definitely, this isn't planned for the near future, I'd say that progress on this can be expected by the end of this year at best.