timmy00979
timmy00979
PPrisma
Created by timmy00979 on 5/3/2024 in #help-and-questions
Dynamically changing DB connection during runtime
Hey y'all! Been looking far and wide and hoping someone has suggestions. Currently trying to figure out how to dynamically change a Prisma connection to a new database. We currently have about 800+ databases that all have the same schema, but need to be able to change databases based on certain params. So like our current Rails API setup is using the built in sharding that came from Octopus. We check a header value from the request and then change the database connection from that value. I'm hoping to achieve something similar where we use some type of hook, grab a value, and then adjust the Prisma connection accordingly. Has anyone achieved something similar? Thank you!
5 replies