Replies: 2 comments
-
Hi!
Yes, I think the only sqlite-specific bits are create/destroy (plus a file lock around migration to address race conditions), which should all get moved upstream into the Rails adapter. At that point, I think we can start testing against PostgreSQL and MySQL (I'm most concerned about race conditions).
I don't think you need to have a switch to flip. Unless you explicitly call I'm curious what breaks if you try to use the gem with PostgreSQL today and you're not creating or destroying tenants. |
Beta Was this translation helpful? Give feedback.
-
I'm so glad to see this being done as a core rails thing :) I've been doing this since about 2007 with a bit of hackery. For MySQL this is what I use to switch the database:
It works well for us. We run a CMS with about 250 clients as seperate tenants. There's of course work we've done around For a Tennant ID we just hash the domain name we first set the site up with (it doesn't change after that) and that seems to work well. It's reliable in terms of no special characters but it does require a mapping between domains and the Tennant record. Postgresql's overlapping schema's always appealed to me where you could have one central schema and then a schema for each Tennant and switch out that way. That way you can join tables between the central schema and the client schema if necessary. Anyway, I'll be keeping an eye on this and will be keen to test any MySQL implementation :) |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
I went over the code and it seems most of it is DB agnostic.
would it be an option for this gem to have two modes of operation?
this will allow us to collaborate gradually without committing to a full implementation of another db functionality
Beta Was this translation helpful? Give feedback.
All reactions