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

Add support for multiple database instances #19

Merged
merged 2 commits into from
Nov 3, 2023
Merged

Add support for multiple database instances #19

merged 2 commits into from
Nov 3, 2023

Conversation

connec
Copy link
Member

@connec connec commented Feb 9, 2023

The introduction of "state" in #27 makes me think this is now type-safe enough to be usable.


  • c0b7a18 refactor: move everything from lib into separate modules

    This gives a more concise picture of the full public API, and makes
    navigating the code a bit easier with the large doc comments.

  • 243fc03 refactor: support multiple databases of the same type

    This adds a Marker trait, which just specifies a database Driver
    implementing sqlx::Database. APIs now use Marker as the bound for
    DB generic type parameters. There is a trivial blanket implementation
    for all types implementing sqlx::Database which makes this backwards
    compatible.

This gives a more concise picture of the full public API, and makes
navigating the code a bit easier with the large doc comments.
This adds a `Marker` trait, which just specifies a database `Driver`
implementing `sqlx::Database`. APIs now use `Marker` as the bound for
`DB` generic type parameters. There is a trivial blanket implementation
for all types implementing `sqlx::Database` which makes this backwards
compatible.
@connec connec marked this pull request as ready for review November 3, 2023 21:57
@connec connec merged commit 0325d41 into master Nov 3, 2023
19 checks passed
@connec connec deleted the multi-db branch November 3, 2023 21:57
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.

1 participant