Separating Dev + Prod Replit DBs

Is there a good way to separate dev and prod/deployment replit DBs?

Right now it appears that deployments use the same DB as development environment replits.

This is often not ideal as most developers want to maintain separate data for these two environments.

You can set environment variables in the deployment settings and set up your db connection based on that

To clarify, I meant how do you use two different Replit DBs? As far as I can tell, only one is created per repl. So maybe my question boils down to how can I create a second replit db for a particular repl?

As far as I know the only way to do that would be to create a second repl and get the URL for its DB and the URL for the first repl’s DB and use a DB proxy. This is unadvisable as there are security issues with DB proxies.
Here is an attempt at a secure DB proxy although I cannot vouch for it: Secure DB proxy? - #53 by GrimSteel
Here is how to get the DB URL: Stop creating Replit DB proxies NOW! - #27 by QwertyQwerty88

2 Likes