Building without available db connection #4449
Unanswered
ValentinBilla
asked this question in
Q&A
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Hi everyone, I am having a hard time making a SvelteKit app compile using drizzle-orm.
By my understanding, drizzle requires a connection to the database even at build time, as I would like to create a docker image this is quite a hassle to provide during the build stage.
Is there any way to gracefully skip the database connection ?
I tried creating a mock db (by creating an undefined client that I type as a MySQL2Client forcefully) whenever NODE_ENV is build but this only results in other errors down the line as the db is of course not functionnal.
One person on stack overflow decided to simply set the db to null and thereafter put a condition in each and everyone of his db functions eg.
Which I guess is functionnal but leaves me thinking that there must be a better way.
Beta Was this translation helpful? Give feedback.
All reactions