-
Notifications
You must be signed in to change notification settings - Fork 51
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
DBinterface.jl Support #271
Conversation
I noticed you added a prepare dispatch but didn't test it, is there a reason for that? Could you add a small test? Otherwise this looks good. |
Good catch, just added a test. |
Co-authored-by: Eric Davies <[email protected]>
Co-authored-by: Eric Davies <[email protected]>
@@ -0,0 +1,9 @@ | |||
DBInterface.connect(::Type{Connection}, args...; kws...) = Connection(args...; kws...) | |||
|
|||
DBInterface.prepare(conn::Connection, args...; kws...) = prepare(conn, args...; kws...) |
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.
Is there a reason why this function needs to have separate, identically named bindings with identical method signatures in DBInterface and LibPQ? If a dependency on DBInterface is added anyway, it seems like the current definition of prepare
could just extend then reexport the binding from DBInterface. Same for execute
.
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.
LibPQ.jl is not currently fully compliant with the interface. The solution presented here avoids bringing it into compliance in favour of providing partial compliance. The future solution to bring it into compliance is either to augment LibPQ.jl's interface to bring it to compliance, or to wrap that interface with a compliant one, and this strategy allows both options.
An example of partial compliance: prepare
does not have a do-block form. In LibPQ.jl, I think it would make the most sense if that form actually used the function to operate on the statement and then deallocate the statement at the end, rather than the DBInterface method which says the function should be f()::DBInterface.Connection
(I don't see why that would be particularly useful). Having separate dispatches for these two functions allows both to be implemented in the future.
Can you rebase on the latest |
potentially closes #206, cc @TheCedarPrince