Hey All,
Hoping to get some help here as i’m a bit stuck.
Ultimately i’m trying to set up dynamic database connections for a multi-tenant architecture (DB per tenant) much like @bpj got working in this post:
My first problem is just setting up a 2nd DB connection in Wappler that would in theory act as the DB that holds the client DB credentials etc.
I’m working in a Node.JS on a Docker target with the standard Docker DB set up.
I can easily add the DBs via direct connection the Wappler DB manager and the connection works:
This connection works and i can add/delete tables and fields etc.
When i go to run a server action using a query with this connection:
I get the following error:
{"status":"500","code":"ECONNREFUSED","message":"connect ECONNREFUSED 127.0.0.1:9906","stack":"Error: connect ECONNREFUSED 127.0.0.1:9906\n at TCPConnectWrap.afterConnect [as oncomplete] (net.js:1141:16)"}
The actual DB connection details look like:
Things i have tried:
- Changing ‘localhost’ to the ip address 127.0.0.1
- Opening and saving the Target settings
- Closing and redeploying the target and Docker multiple times
Is this an issue that i’m trying to do a Direct Connection to the DB in the docker container?
Would this have been fine if it was a standard remote DB?
How else can i set up multiple DB connections in a docker dev environment to be able to achieve the desired outcome?
Open to any info or ideas
Last updated: