Skip to content

WIP breaking(sqlite): libsqlite3-sys versioning, feature flags, extension loading is unsafe #3928

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

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

abonander
Copy link
Collaborator

@abonander abonander commented Jul 8, 2025

Changes to unreleased code (fold together with related PRs)

  • Rename config key common.drivers.sqlite.load-extensions to drivers.sqlite.unsafe-load-extensions
  • Added drivers.mysql, drivers.postgres, and support for future external drivers

Breaking Changes

  • Changed libsqlite3-sys versioning policy to use version ranges
  • Mark SqliteConnectOptions::extension() and ::extension_with_entrypoint() as unsafe
  • Added new non-default features corresponding to conditionally compiled SQLite APIs:
    • sqlite-deserialize enabling SqliteConnection::serialize() and SqliteConnection::deserialize()
    • sqlite-load-extension enabling SqliteConnectOptions::extension() and ::extension_with_entrypoint()
    • sqlite-unlock-notify enables internal use of sqlite3_unlock_notify()

TODO

  • sqlite3_value is not safe to access concurrently
  • list all the issues this fixes

@abonander abonander changed the title WIP breaking(sqlite): libsqlite3-sys versioning, feature flags, ext… WIP breaking(sqlite): libsqlite3-sys versioning, feature flags, extension loading is unsafe Jul 8, 2025
…ension loading `unsafe`

# Changes to unreleased code (fold together with related PRs)

* Rename config key `common.drivers.sqlite.load-extensions` to `drivers.sqlite.unsafe-load-extensions`
* Added `drivers.mysql`, `drivers.postgres`, and support for future external drivers

# Breaking Changes

* Changed `libsqlite3-sys` versioning policy to use version ranges
    * Diesel has been using this successfully for many years: https://github.com/diesel-rs/diesel/blob/cdf7c51c35da7ebc6fb12e71857bfba8487c20cd/diesel/Cargo.toml#L53
* Mark `SqliteConnectOptions::extension()` and `::extension_with_entrypoint()` as `unsafe`
* Added new non-default features corresponding to conditionally compiled SQLite APIs:
    * `sqlite-deserialize` enabling `SqliteConnection::serialize()` and `SqliteConnection::deserialize()`
    * `sqlite-load-extension` enabling `SqliteConnectOptions::extension()` and `::extension_with_entrypoint()`
    * `sqlite-unlock-notify` enables internal use of `sqlite3_unlock_notify()`

# TODO

- [ ] `sqlite3_value` is not safe to access concurrently
- [ ] list all the issues this fixes
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant