Multi tenancy/Using multiple schemas #2237
windowsdeveloperwannabe
started this conversation in
General
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hello 🙂
Has anyone figured a way to do multi tenancy in SQLx yet?
Is there a way to
SET search_path TO {customer}
before a query orFROM {customer}.tablename
in the query itself? Or would you create a database connection per customer using?search_path={customer}
in database url and hold them in a map likeHashMap<Customer, PgPool>
?Interesting approaches in Rails and Elixir:
https://hexdocs.pm/ecto/multi-tenancy-with-query-prefixes.html
https://github.com/rails-on-services/apartment
Beta Was this translation helpful? Give feedback.
All reactions