#sqlite #database-driver #sqlx #sql-database #async #postgresql #maria-db

sqlx-sqlite

SQLite driver implementation for SQLx. Not for direct use; see the sqlx crate for details.

13 releases

new 0.8.3 Jan 4, 2025
0.8.2 Sep 3, 2024
0.8.1 Aug 24, 2024
0.8.0 Jul 23, 2024
0.0.0 Nov 27, 2019

#1296 in Database interfaces

Download history 349708/week @ 2024-09-20 334737/week @ 2024-09-27 374463/week @ 2024-10-04 357027/week @ 2024-10-11 390735/week @ 2024-10-18 425632/week @ 2024-10-25 378118/week @ 2024-11-01 398025/week @ 2024-11-08 408117/week @ 2024-11-15 344918/week @ 2024-11-22 318847/week @ 2024-11-29 401777/week @ 2024-12-06 396216/week @ 2024-12-13 170356/week @ 2024-12-20 169824/week @ 2024-12-27 386758/week @ 2025-01-03

1,206,575 downloads per month
Used in 702 crates (4 directly)

MIT/Apache

795KB
15K SLoC

SQLite database driver.

Note: linkage is semver-exempt.

This driver uses the libsqlite3-sys crate which links the native library for SQLite 3. With the "sqlite" feature, we enable the bundled feature which builds and links SQLite from source.

We reserve the right to upgrade the version of libsqlite3-sys as necessary to pick up new 3.x.y versions of SQLite.

Due to Cargo's requirement that only one version of a crate that links a given native library exists in the dependency graph at a time, using SQLx alongside another crate linking libsqlite3-sys like rusqlite is a semver hazard.

If you are doing so, we recommend pinning the version of both SQLx and the other crate you're using to prevent a cargo update from breaking things, e.g.:

sqlx = { version = "=0.8.1", features = ["sqlite"] }
rusqlite = "=0.32.1"

and then upgrade these crates in lockstep when necessary.

Dynamic linking

To dynamically link to a system SQLite library, the "sqlite-unbundled" feature can be used instead.

This allows updating SQLite independently of SQLx or using forked versions, but you must have SQLite installed on the system or provide a path to the library at build time (See the rusqlite README for details).

It may result in link errors if the SQLite version is too old. Version 3.20.0 or newer is recommended. It can increase build time due to the use of bindgen.

Dependencies

~33MB
~524K SLoC