There are actually some ways to do that, but most of them are not a good practice at all. When I first started triplex, it was the default behaviour: we were saving the “current_tenant” to the process dict and using it to apply the prefix to all your Repo calls, but then we’ve noticed a lot of problems with that practice and concurrency.
It might seem a little bit unDRY the way it is now, but we decided to be hands-off and explicit over implicit on this. So, if you want, you can manually make exactly what we were doing, but be prepared to have some problems with concurrency anytime.
Well, the only thing these plugs do is to extract the tenant from somewhere and to save it to your Plug.Conn assigns. The docs are explaining how they work.
The method Triplex.to_prefix does the job of transforming the tenant on its corresponding prefix.






















