-
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
Closed
Closed
Changes from 4 commits
Commits
Show all changes
7 commits
Select commit
Hold shift + click to select a range
6b25452
DBInterface integration
chris-b1 a0cd896
remove module prefix
chris-b1 8d6a987
fmt
chris-b1 4f746fb
fmt again
chris-b1 3429f49
add test for DBInterface.prepare
chris-b1 7f380dd
Update test/runtests.jl
chris-b1 81e68da
Update test/runtests.jl
chris-b1 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,5 @@ | ||
.DS_Store | ||
.vscode | ||
*.jl.cov | ||
*.jl.*.cov | ||
*.jl.mem | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
DBInterface.connect(::Type{Connection}, args...; kws...) = Connection(args...; kws...) | ||
|
||
DBInterface.prepare(conn::Connection, args...; kws...) = prepare(conn, args...; kws...) | ||
|
||
function DBInterface.execute(conn::Union{Connection,Statement}, args...; kws...) | ||
return execute(conn, args...; kws...) | ||
end | ||
|
||
DBInterface.close!(conn::Connection) = close(conn) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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 forexecute
.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 bef()::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.