Skip to content

Add support for SQLITE_DIRECTONLY and SQLITE_INNOCUOUS for user-defined functions #84943

Description

@erlend-aasland
BPO 40766
Nosy @erlend-aasland
PRs
  • gh-84943: Add support for 'directonly' and 'innocuous' flags for user-defined functions #20398
  • Note: these values reflect the state of the issue at the time it was migrated and might not reflect the current state.

    Show more details

    GitHub fields:

    assignee = None
    closed_at = None
    created_at = <Date 2020-05-25.11:13:46.593>
    labels = ['3.8', 'library', '3.9', '3.10']
    title = 'Add support for SQLITE_DIRECTONLY and SQLITE_INNOCUOUS for user-defined functions'
    updated_at = <Date 2020-05-25.20:52:22.374>
    user = 'https://github.com/erlend-aasland'

    bugs.python.org fields:

    activity = <Date 2020-05-25.20:52:22.374>
    actor = 'erlendaasland'
    assignee = 'none'
    closed = False
    closed_date = None
    closer = None
    components = ['Library (Lib)']
    creation = <Date 2020-05-25.11:13:46.593>
    creator = 'erlendaasland'
    dependencies = []
    files = []
    hgrepos = []
    issue_num = 40766
    keywords = ['patch']
    message_count = 1.0
    messages = ['369871']
    nosy_count = 1.0
    nosy_names = ['erlendaasland']
    pr_nums = ['20398']
    priority = 'normal'
    resolution = None
    stage = 'patch review'
    status = 'open'
    superseder = None
    type = None
    url = 'https://bugs.python.org/issue40766'
    versions = ['Python 3.8', 'Python 3.9', 'Python 3.10']

    Linked PRs

    Activity

    1. erlend-aasland commented on May 25, 2020

      @erlend-aasland
      ContributorAuthor

      Add support for SQLITE_DIRECTONLY and SQLITE_INNOCUOUS in sqlite3.create_function() and sqlite3.create_aggregate().

      From the SQLite 3.31.0 changelog:

      • Provide the ability to tag application-defined SQL functions with new properties SQLITE_INNOCUOUS or SQLITE_DIRECTONLY.

      https://www.sqlite.org/c3ref/c_deterministic.html#sqlitedirectonly
      https://www.sqlite.org/changes.html

    2. transferred this issue fromon Apr 10, 2022
    3. moved this to In Progress in sqlite3 issueson May 21, 2022
    4. erlend-aasland commented on Jul 23, 2022

      @erlend-aasland
      ContributorAuthor

      I'm closing this; there has been no other requests for such features, and there has been no response to this ticket. If the need for these flags arises, we can reopen, or create a new issue.

    5. Repository owner moved this from In Progress to Done in sqlite3 issueson Jul 23, 2022
    6. added this to IDLE Issues and removed this from IDLE Issueson Jul 23, 2022
    7. moved this from Done to Discarded in sqlite3 issueson Jul 24, 2022
    8. added 2 commits that reference this issue on May 17, 2026
    9. jbosboom commented on May 17, 2026

      @jbosboom
      Contributor

      Requesting reopen. I'm using triggers to keep multiple full-text search tables in sync with each other and with the content tables, and I want to use a str -> str Python function in the body of those triggers, which requires marking it innocuous or giving up trusted_schema protection. I wouldn't normally request this given no one else has asked for it in years, but trusted_schema is a security feature, so I think it merits supporting in the standard library. I updated your PR.

    10. added a commit that references this issue on May 17, 2026
    11. added 2 commits that reference this issue on Aug 19, 2026
    Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

    Metadata

    Metadata

    Assignees

    No one assigned

      Labels

      3.10 (EOL)end of life3.8 (EOL)end of life3.9 (EOL)end of lifestdlibStandard Library Python modules in the Lib/ directorytopic-sqlite3type-featureA feature request or enhancement

      Projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions