-
-
Notifications
You must be signed in to change notification settings - Fork 1k
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
Extract generic traits from postgresql structs #72
Conversation
In order to allow multiple database implementations, `Connection` and `DbResult` have been promoted to Traits instead of structs A new folder *postgresql* have been added with the relevant postgresql implementation.
Thanks for the PR. There's some failing tests, but I think I can handle getting them passing. I think it's still a bit premature to try and genericise these interfaces, but this all seems pretty reasonable at first glance. This is a pretty hefty PR, so it'll take me a day or two to get through it. |
Of course I understand.
|
also rename - `PGConnection` to `PgConnection` - `PGDbResult` to `PgDbResult`
Pushed one more commit to relocate postgresql data types and extensions to postgresql directory. EDIT: Also renamed |
Hey just wanted to update why I haven't given this much attention lately. I've started to give more thought to sqlite 3 support, and there's a couple of hard problems that need to be solved.
Both of these lead me to believe that we very well might end up simply having the traits themselves have different APIs based on a In any case, I'm hesitant to do some of the easier changes until we figure out the harder ones. |
Note: I wrote up some very long thoughts on this issue overall in #39 (comment) |
_marker: PhantomData<(ST, T)>, | ||
} | ||
|
||
impl<ST, T> Cursor<ST, T> { | ||
impl<ST, T, R> Cursor<ST, T, R> where |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
While we may go this route in the future, to limit the scope of this PR, I'd prefer that we did not change this type, and instead had the various methods on Connection
return Box<Iterator>
No pb!
|
In order to allow multiple database implementations,
Connection
andDbResult
have been promoted to Traits instead of structsA new folder postgresql have been added with the relevant postgresql implementations (PGConnection, PGDbResult and the query builder)
This is a first step toward a generic ORM. Hopefully implementing diesel for new databases will be a matter of adding a new folder + some sql changes.
NOTE: I don't have a postgresql installed on my machine so I couldn't run the tests. I even couldn't compile tests because of linking issues. Still I think this is a good first step ....