-
-
Notifications
You must be signed in to change notification settings - Fork 478
Adding in generic connection trait back to the lib #525
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
Conversation
fn query(&mut self, query: &str, params: &[&(dyn ToSql + Sync)]) -> Result<Vec<Row>, Error> { | ||
self.query(query, params) | ||
} | ||
fn prepare(&mut self, query: &str) -> Result<Statement, Error> { |
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.
It seems strange that you can prepare a statement but not use it through this interface.
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.
Whoops sorry I didn't even realize that query (and execute) had a generic, I have updated them to include the same trait and generic as the normal implementations
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.
That does mean that the trait isn't object safe, if that's relevant for what you're trying to do with it.
This add `execute_raw`, `query_one`, `query_opt`, `query_raw`, and `prepare_typed` to the generic trait introduced in sfackler#525.
This adds `execute_raw`, `query_one`, `query_opt`, `query_raw`, and `prepare_typed` to the generic trait introduced in sfackler#525.
I am trying to add back in the generic connection trait that existed for connections and traits in version 0.15.2 but was not put back in when this lib was rebuilt. This work is based on an existing closed PR: #433. I wasn't exactly sure where to put the generic connection so I added it in a new file but it could easily be moved to the lib.rs or even client.rs. I also used the old name of GenericConnection instead of GenericClient used in the old PR. All available feedback is requested.