-
Notifications
You must be signed in to change notification settings - Fork 1.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add extension support for SQLite (#2062)
* Add extension support for SQLite While SQLite supports loading extensions at run-time via either the C API or the SQL interface, they strongly recommend [1] only enabling the C API so that SQL injections don't allow attackers to run arbitrary extension code. Here we take the most conservative approach, we enable only the C function, and then only when the user requests extensions be loaded in their `SqliteConnectOptions`, and disable it again once we're done loading those requested modules. We don't add any support for loading extensions via environment variables or connection strings. Extensions in the options are stored as an IndexMap as the load order can have side effects, they will be loaded in the order they are supplied by the caller. Extensions with custom entry points are supported, but a default API is exposed as most users will interact with extensions using the defaults. [1]: https://sqlite.org/c3ref/enable_load_extension.html * Add extension testing for SQlite Extends x.py to download an appropriate shared object file for supported operating systems, and uses wget to fetch one into the GitHub Actions context for use by CI. Overriding LD_LIBRARY_PATH for only this specific DB minimises the impact on the rest of the suite.
- Loading branch information
Showing
6 changed files
with
235 additions
and
4 deletions.
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
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
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