How do we have different database connections having separate metadatabase connections per tenant?

Example:- Tenant-1: Database-1 Tenant-2: Database-2

If user login is of tenant-1 SQLALCHEMY_DATABASE_URI = 'postgresql+psycopg2:// dbusername:dbpassword@localhost/ Database-1' else if user login is of tenant-2 SQLALCHEMY_DATABASE_URI = 'postgresql+psycopg2:// dbusername:dbpassword@localhost/ Database-2'

Therefore the user is login and belongs to whichever tenant SQLALCHEMY_DATABASE_URI database connection to be changed to according to that tenant

  • browser type and version: Chrom
  • superset version: 2.0.1
  • python version: 3.8.0
  • node.js version: 16.14.2

Comment From: raxit-technosouls

I have similar use case, any advise how to handle?

Comment From: ghost

I too have similar usecase. Our problem is we cannot keep data of two clients in single database. So row level security is out of question for us. Only option is to have separate database schemas.

Comment From: busyboy77

Vote++

Comment From: k31thchan

I guess it is more like feature request?

Comment From: williamsdb

Yes, when I first asked I assumed it was possible but it seems not.

Comment From: aldipee

Any update on this?

Comment From: rusackas

No update here, and I'd say it's not likely as a core feature. Closing this since it's not a bug, but a feature request. Typically, if people need multiple tenants, they spin up multiple instances (e.g. in Preset, we call these Workspaces). It is possible to do so, though non-trivial, and again not likely to be a Superset feature in the near future. If anyone is truly interested in implementing this, however, we'd be open to a SIP (Superset Improvement Proposal) and can provide more information on that process if needed.

Comment From: busyboy77

We can sponsor this achievement ( with certain conditions ). Please share the way forward. Thank you

Comment From: rusackas

@busyboy77 this would be a large enough change that people will have myriad security concerns and want to thoroughly review/discuss any architectural/permissions changes. You can submit a SIP if you'd like to propose a technical approach for this.

Comment From: joeyJsonar

Hello, we will try to give this a crack as this is a very high priority for us.