How to switch database in runtime? #283
-
Say I have a database foo in pgsql, I was connecting to this database at the beginning, but later I want to switch to another database bar, should I simply run another client connect to bar or what should I do? |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
PCR is only designed to be used with one type of database at a time, since the generated client can be different for each database. If you want to switch reliably then you'd need to regenerate the client and go from there. I guess you could swap out the connection url and enable the new database via cargo features, but I really wouldn't recommend it. |
Beta Was this translation helpful? Give feedback.
PCR is only designed to be used with one type of database at a time, since the generated client can be different for each database. If you want to switch reliably then you'd need to regenerate the client and go from there. I guess you could swap out the connection url and enable the new database via cargo features, but I really wouldn't recommend it.