triplex icon indicating copy to clipboard operation
triplex copied to clipboard

Bug: Triplex.all/1 does not consider tenant_prefix

Open MMore opened this issue 3 years ago • 2 comments

Hello!

I have a database with different schemata, some belong to tenants, some not. To separate it better with Triplex, I am using the tenant_prefix config option. When I run Triplex.all() I'd expect to get only schemata which start with that configured prefix. But I just get all schemata in the database. I've noticed thatTriplex.exists?/1 takes the tenant_prefix into consideration.

MMore avatar Jun 27 '21 14:06 MMore

Hey @MMore, thanks for pointing that out. A PR for that is welcome. Also, you might want to check #74, and talk to @abarr, since he was working on some improvements to Triplex.all already.

kelvinst avatar Jul 01 '21 13:07 kelvinst

Also, if you need to workaround it, you can use the config reserved_tenants to make sure that schema is not going to be created as well as not returned on Triplex.all

kelvinst avatar Jul 01 '21 13:07 kelvinst