MinecraftCommands / mcc-tools

A set of tools for the Minecraft Commands community
https://www.mcc-gadgets.com/
MIT License
4 stars 2 forks source link

Improve DB handling in preview #7

Open vdvman1 opened 2 weeks ago

vdvman1 commented 2 weeks ago

To avoid things potentially breaking when previewing PRs and branches, it would be good to include a prefix in the tables.

Currently Prisma is used for the DB ORM, however Prisma doesn't really support using different DB prefixes for different environments, due to how it handles migrations.

As such, the ORM should be switched to Drizzle ASAP and this prefixing setup, before any features that require the database are implemented

MulverineX commented 2 weeks ago

Drizzle's API isn't as cushy nor as type-safe, but I understand wanting to avoid a bunch of environment code to get around its limitations in split deployments

vdvman1 commented 2 weeks ago

AFAIK Drizzle has a pretty typesafe API, but I haven't looked too much into it yet, I just know it has this particular feature and that it has been recommended to me, I'm open to other suggestions though.

Also I'm sure we can work around type difficulties more easily than working around Prisma's migration system, since we can always wrap things in server actions, regular functions, and/or tRPC