Does ecto_sqlite3 supports the query prefixes?
Closed this issue · 5 comments
I'm wondering if ecto_sqlite3 supports query prefixes in the Query/Schema API. I'm considering using multiple SQLite databases instead of a bigger one (one for each client) and the query prefixes could be very helpful in this scenario.
If it doesn't support today, what do you think it would take to implement the feature? I'm not that familiar with the codebase just yet, hence the question.
It should support query prefixes. But they do not function like they do in the postgres adapter which I believe shifts to a different schema.
Yeah, I wonder how query prefixes would work: would they query another table, based on the prefix - or would it query another SQLite database?
@joeljuca it would just prefix the table names unfortunately. SQLite does not have any notion of schemas. It's all just one schema. Not ideal, but also not a huge deal.
As for using multiple databases, check out https://hexdocs.pm/ecto/replicas-and-dynamic-repositories.html
Awesome! Thank you, @warmwaffles!
I've had good success with dynamic repos, but they are quirky, and running migrations across all of them is a release task that you need to program for. Not the end of the world.