Globals Database Connections with multiple targets

I have a project with 3 databases, one local hosted in docker by Wappler and two in other projects.

I also have 3 targets, one local: Development, and two in remotes: Staging and Production.

When on target Development all my 3 databases run on localhost and everything work in the ‘Database Manager’ and the ‘Server Connect’ panel: I can run changes, see data or apply seed, and each API action querying the databases return data from the correct one.

But when I switch to one of the remote targets, for example Staging only the panel ‘Database Manager’ is updated with the correct configuration. The database handled by Wappler run correctly because the configuration does not change: in target Development it’s hosted in a docker on the network of the web server, and in remote targets too.

The issue is with the two databases that run outside of Wappler. The ‘Database Connections’ object in ‘Globals’ in the ‘Server Connect’ panel is not updated when switching from a target to another.

So when I’m in Development, both connection options in database manager and server connect have the host localhost and when switching to Staging the connection option in database manager is updated to my.custom.host.com for database 2 (for example) and I can access my staging data but in server connect the connection options is still localhost.

Any idea how to handle multiple databases with configuration bound at target level?

Community Page
Last updated: