Using Different SQL DBs (Test vs Prod) in One Bubble App?

Hi everyone,

I’m building a Bubble app that relies entirely on an external SQL database (via the SQL Database Connector plugin). I have a test SQL DB and a production SQL DB.

Since the SQL plugin doesn’t support environment-specific connection strings like the API Connector does, I’ve been forced to create two completely separate Bubble apps:

  • One connected to the test DB (for development)
  • One connected to the prod DB (for live)

That means every feature I build — pages, workflows, logic, queries — has to be manually duplicated across both apps. I work full-time in Bubble , so this creates a lot of redundant effort and risk of inconsistencies.

I’ve considered using duplicate queries inside a single app and conditionally calling the right one based on app version is live, but even that feels messy and hard to maintain long-term.

Has anyone found a better way to manage test/prod SQL environments within a single app? Or is there a workaround to dynamically switch the connection string or route SQL queries differently depending on the environment?

This is definitely a better solution that having two Bubble apps.

Alternatively, I’d consider leaving the SQL Database Connector plugin and forge my own API calls via API connector.

I know that Xano uses a custom HTTP header (X-data-source) for selecting a specific environment to apply the query. But that’s Xano’s implementation. Explore your SQL database instance documentation and check if it has something similar.

1 Like

This is indeed a big problem if one uses SQL DB Connector.