Skip to content
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

Add extension support for SQLite #2062

Merged
merged 2 commits into from
Sep 1, 2022

Commits on Sep 1, 2022

  1. 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
    bradfier committed Sep 1, 2022
    Configuration menu
    Copy the full SHA
    9e2e601 View commit details
    Browse the repository at this point in the history
  2. 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.
    bradfier committed Sep 1, 2022
    Configuration menu
    Copy the full SHA
    7505539 View commit details
    Browse the repository at this point in the history