-
Notifications
You must be signed in to change notification settings - Fork 79
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
Tentative refactor of SQLite.jl #295
Conversation
1. Use Clang.jl to generate API bindings (a new C module). 2. Separate functions to different files for clarity. 3. Use WeakKeyDict to record prepared statements of a DB, so that statements can be GCed without influence. 4. Only public API change: Change `SQLite.execute` to `SQLite.direct_execute` to avoid name confusion with `DBInterface.execute`.
For |
Codecov Report
@@ Coverage Diff @@
## master #295 +/- ##
===========================================
- Coverage 85.99% 54.78% -31.21%
===========================================
Files 5 12 +7
Lines 707 1086 +379
===========================================
- Hits 608 595 -13
- Misses 99 491 +392
Continue to review full report at Codecov.
|
@@ -42,7 +42,7 @@ Copy test sqlite file to temp directory, path `test.sqlite`, | |||
overwrite file if necessary and set permissions. | |||
""" | |||
function setup_clean_test_db(f::Function, args...) | |||
dbfile = joinpath(dirname(pathof(SQLite)), "../test/Chinook_Sqlite.sqlite") | |||
dbfile = joinpath(@__DIR__, "Chinook_Sqlite.sqlite") |
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.
can we revert this change? I like the pathof
style since it makes it much easier for running this locally, step-wise, in the REPL.
using Tables | ||
|
||
include("capi.jl") | ||
import .C as C |
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.
I think this can just be import .C
since the as
isn't renaming it at all. This is also causing test failures for Julia 1.3 (as
didn't exist then). I'm also fine bumping the Julia version up to 1.6 though.
This looks great! Thanks for doing this @metab0t! I really like the auto-generated C bindings. In the future, just as an FYI, it can make reviewing much easier to avoid reorganizing files in addition to lots of changes. I don't really mind the file reorganizing, but from a |
Thanks for reviewing! My current plan is to separate it into 3 PRs:
I will close this huge PR after I finish the separation. |
@metab0t , good to close this now? |
Yes, it can be closed. |
SQLite.execute
toSQLite.direct_execute
to avoid name confusion withDBInterface.execute
.The tests are almost unchanged and all passed on my machine.
Should fix #278 and provides a better basis for #284.
I can separate it into smaller PRs if it is needed.