Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improve DB handling in preview #7

Open
vdvman1 opened this issue Jun 17, 2024 · 2 comments
Open

Improve DB handling in preview #7

vdvman1 opened this issue Jun 17, 2024 · 2 comments

Comments

@vdvman1
Copy link
Collaborator

vdvman1 commented Jun 17, 2024

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
Copy link
Collaborator

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
Copy link
Collaborator Author

vdvman1 commented Jun 17, 2024

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants