unkeyed / unkey

Open source API management platform
https://go.unkey.com
Other
2.55k stars 244 forks source link

Allow using local mysql as well as planetscale #490

Open chronark opened 7 months ago

chronark commented 7 months ago

Preliminary Checks

Description

An switch of some sort here should be enough to allow you to run the web app against any mysql db

https://github.com/unkeyed/unkey/blob/main/apps/web/lib/db.ts

DarthBenro008 commented 7 months ago

I am interested to pick this up, as this would also enable really easy dev setups for contributions.

against any mysql db

I understand this issues only asks for "MySQL" DB, but just a forward thought, we are already using drizzle as an ORM, are we looking at possibilities to extend support to other SQL servers too for future? Would that be something beneficial?

Pros:

Cons:

Would like to know your thoughts

chronark commented 7 months ago

I'm not sure if dbs other than mysql are easy to support, since the schema uses mysql specific functions from drizzle. I might be totally wrong here though, so if it's possible without having do duplicate schemas or being incredibly annoying to maintain, I'm all for it

saikumarpb commented 7 months ago

@chronark I'm thinking to create a Docker Compose file integrating MySQL as a service and updating the documentation to allow users to push the schema to their local DB or to Planetscale, offering them the flexibility of choice.

I'm thinking of automating all the setup scripts, assuming the necessary environments are in place. This would involve tasks like 'pnpm install', building processes, and running the API and web as Docker services.

Could you share your insights on this approach? If it aligns with the project's goals, I'd love to contribute to this initiative.

bipulpoudel commented 7 months ago

@chronark , this seems to be straightfoward, in drizzle orm docs too:

https://orm.drizzle.team/docs/quick-mysql/mysql2

@G3root , are you working on it? If not, I can pick this up?