You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I want to write UTs that test interractions with DB. I dont want to use my Dev DB which i use in day-to-day testing and interation.
I want my UT to be isolated, so each UT requires its own DB (inmemory or as file, whatever it means).
I couldnt find a programmatic way to create DB given my schema in tests. I can pass datasource to change DB, but it still requires me to run DB push beforehand to create all the tables.
Problem
I want to write UTs that test interractions with DB. I dont want to use my Dev DB which i use in day-to-day testing and interation.
I want my UT to be isolated, so each UT requires its own DB (inmemory or as file, whatever it means).
I couldnt find a programmatic way to create DB given my schema in tests. I can pass
datasource
to change DB, but it still requires me to run DB push beforehand to create all the tables.For this to work, x.db doesnt have to exist, but if you try to actually act on that DB you will get errors as DB does not have proper tables etc.
Suggested solution
add function in python client to do
prisma db push
programaticallyAlternatives
I can call
prisma db push
programatically using some CLI tool, but it seems pointless as client is right thereAdditional context
The text was updated successfully, but these errors were encountered: