Uh oh!
There was an error while loading. Please reload this page.
sqlite: support db.loadExtension - #53900
Conversation
himself65
commented
Jul 17, 2024
Found another small issue: nodejs/core-validate-commit#122 |
avivkeller
commented
Jul 17, 2024
Duplicate of nodejs/core-validate-commit#121 |
himself65
commented
Aug 8, 2024
I will re start this PR |
edb5f58 to
8e80ca7Comparesqlite3.loadExtensionsqlite3.loadExtension8e80ca7 to
200e60bComparesqlite3.loadExtensionsqlite.loadExtensionsqlite.loadExtensiondb.loadExtension141f72c to
10faf88Compare8b1dba0 to
67fe19aComparehimself65
commented
Aug 8, 2024
I have no idea how to write a test for load extension now. |
himself65
commented
Aug 8, 2024
/cc @nodejs/sqlite (no such group?) anyway I cc @nodejs/tsc since this is a breaking change |
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@## main #53900 +/- ##
==========================================
+ Coverage 87.99% 88.52% +0.53%
==========================================
Files 656 657 +1 Lines 188999 189929 +930 Branches 35981 36472 +491 ==========================================
+ Hits 166301 168133 +1832 + Misses 15865 14992 -873 + Partials 6833 6804 -29
|
benjamingr
commented
Aug 8, 2024
cc @cjihrig |
Uh oh!
There was an error while loading. Please reload this page.
cjihrig
commented
Aug 8, 2024
I took a quick look at the code. I'm not sure what makes this a breaking change though. I do think the TSC needs to decide if they want to support loading arbitrary native code in this manner. It wouldn't be the first way that Node supports loading native code, so maybe it's fine.
Is it possible to create a very trivial extension that can be accessed as a test fixture? |
tniessen
commented
Aug 9, 2024
It definitely must be disabled when the experimental permission model is enabled, just like native add-ons etc. |
himself65
commented
Aug 9, 2024
For the native test, I'm not sure if we should build an SQLite binding from scratch or if we should just copy some community dll/so/lib to fixtures. |
targos
commented
Aug 9, 2024
We also need a test that tries to load an unexpected file (that is not a sqlite extension). It should throw, not crash the process. |
Uh oh!
There was an error while loading. Please reload this page.
c01c585 to
1bf194bComparejakecastelli
commented
Aug 10, 2024
IMO we should build from scratch to avoid any potential attack and make update tests fixture easier if we ever need to update them. |
nodejs-github-bot
commented
Dec 6, 2024
cjihrig
commented
Dec 6, 2024
FYI - I think |
6ee1209 to
50715efComparenodejs-github-bot
commented
Dec 7, 2024
himself65
commented
Dec 9, 2024
not sure how to fix it right now. setting up local env on my local windows pc |
himself65
commented
Dec 10, 2024
ok the error is legitimately falling, testing on my windows locally, I think because wrong usage of the cp api |
50715ef to
08280baComparehimself65
commented
Dec 10, 2024
OK, I found because |
nodejs-github-bot
commented
Dec 10, 2024
nodejs-github-bot
commented
Dec 11, 2024
nodejs-github-bot
commented
Dec 11, 2024
nodejs-github-bot
commented
Dec 11, 2024
himself65
commented
Dec 11, 2024
will merge this today |
PR-URL: #53900 Reviewed-By: Matteo Collina <matteo.collina@gmail.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
himself65
commented
Dec 11, 2024
Landed in 5c2f599 |
| return path.join(path.dirname(process.execPath), targetFile); | ||
| } | ||
| const binary = resolveBuiltBinary('libsqlite_extension'); |
There was a problem hiding this comment.
It seems this doesn't work when node is built with --shared-sqlite
Closes#53898
This PR will implement
loadExtensionAPI to align with other SQLite3 JS library likebetter-sqlite3,node-sqlite3,jsr:@db/sqlite,bun:sqliteExample Code: