Skip to content

Extend Database#create_function to support creating deterministic functions #551

@Jackenmen

Description

@Jackenmen

Per Application-Defined SQL Functions documentation, custom SQL functions can be marked as deterministic by setting SQLITE_DETERMINISTIC bit. This allows such functions to be used in certain contexts where they otherwise wouldn't be able to such as with the WHERE clause of partial indexes or in generated columns (https://www.sqlite.org/c3ref/c_deterministic.html#sqlitedeterministic).

As a point of reference, the better-sqlite3 library exposes this through the options argument in its Database#function() method. One more option that it exposes through this mechanism is SQLITE_DIRECTONLY bit so it may make sense to support that as well.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions