Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support multiple databases #52

Merged
merged 6 commits into from
Mar 24, 2024
Merged

Support multiple databases #52

merged 6 commits into from
Mar 24, 2024

Conversation

gaelrenoux
Copy link
Owner

@gaelrenoux gaelrenoux commented Mar 9, 2024

This adds a mechanism to support multiple databases in an application (ticket #51).

It does so by providing a DatabaseT[M] class, where M is a marker type that can be different for all databases (T is for "Typed"). Not sure if that's the best solution, I welcome remarks on this. I also don't like the name DatabaseT. I considered DatabaseCustom but didn't like it either.

See the LayeredAppMultipleDatabases example for a demonstration of how to use it.

Needs documentation before merging (especially in the README).

@gaelrenoux gaelrenoux self-assigned this Mar 9, 2024
@gaelrenoux gaelrenoux changed the title [WIP] Support multiple databases Support multiple databases Mar 24, 2024
@gaelrenoux gaelrenoux merged commit cfc719f into master Mar 24, 2024
1 check passed
@gaelrenoux gaelrenoux linked an issue Mar 24, 2024 that may be closed by this pull request
@gaelrenoux gaelrenoux deleted the Support-multiple-databases branch March 24, 2024 14:17
@xQwexx
Copy link
Contributor

xQwexx commented Mar 27, 2024

This is a really nice feature, we needed to do something hacky to work with multiple DB's.

I have just one questions for this:
Shouldn't be the Connection also tagged?
If the two database has different schemas then the query would only valid in one of them. It would be nice to express that in the type level.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add support of multiple databases
2 participants