_sqlite only.Expand description
SQLite database driver.
§Note: libsqlite3-sys Version
This driver uses the libsqlite3-sys crate which links the native library for SQLite 3.
Only one version of libsqlite3-sys may appear in the dependency tree of your project.
As of SQLx 0.9.0, the version of libsqlite3-sys is now a range instead of any specific version.
See the Cargo.toml of the sqlx-sqlite crate for the current version range.
If you are using rusqlite or any other crate that indirectly depends on libsqlite3-sys,
this should allow Cargo to select a compatible version.
If Cargo fails to select a compatible version, this means the other crate is using
a libsqlite3-sys version outside of this range.
We may increase the maximum version of the range at our discretion, in patch (SemVer-compatible) releases, to allow users to upgrade to newer versions as desired.
The minimum version of the range may be increased over time to drop very old or insecure versions of SQLite, but this will only occur in major (SemVer-incompatible) releases.
Note that this means a cargo update may increase the libsqlite3-sys version,
which could, in rare cases, break your build.
To prevent this, you can pin the libsqlite3-sys version in your own dependencies:
[dependencies]
# for example, if 0.35.0 breaks the build
libsqlite3-sys = "0.34"§Static Linking (Default)
The sqlite feature enables the bundled feature of libsqlite3-sys,
which builds SQLite 3 from included source code and statically links it into the final binary.
This requires some C build tools to be installed on the system; see
the rusqlite README for details.
This version of SQLite is generally much newer than system-installed versions of SQLite
(especially for LTS Linux distributions), and can be updated with a cargo update,
so this is the recommended option for ease of use and keeping up-to-date.
§Dynamic linking
To dynamically link to an existing 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).
Note that this may result in link errors if the SQLite version is too old, or has certain features disabled at compile-time.
SQLite version 3.20.0 (released August 2018) or newer is recommended.
Please check your SQLite version and the flags it was built with before opening
a GitHub issue because of errors in libsqlite3-sys. Thank you.
§Optional Features
The following features
Modules§
Structs§
- Locked
Sqlite Handle - Preupdate
Hook Result - Sqlite
- Sqlite database driver.
- Sqlite
Arguments - Sqlite
Arguments Buffer - Sqlite
Column - Sqlite
Connect Options - Options and flags which can be used to configure a SQLite connection.
- Sqlite
Connection - A connection to an open Sqlite database.
- Sqlite
Error - Sqlite
Owned Buf - Memory buffer owned and allocated by SQLite. Freed on drop.
- Sqlite
Query Result - Sqlite
Row - Implementation of
Rowfor SQLite. - Sqlite
Statement - Sqlite
Transaction Manager - Implementation of
TransactionManagerfor SQLite. - Sqlite
Type Info - Type information for a SQLite type.
- Sqlite
Value - An owned handle to a
sqlite3_value. - Sqlite
Value Ref - A borrowed reference to a
sqlite3_value. - Update
Hook Result
Enums§
- Sqlite
Argument Value - Sqlite
Auto Vacuum - Sqlite
Journal Mode - Refer to SQLite documentation for the meaning of the database journaling mode.
- Sqlite
Locking Mode - Refer to SQLite documentation for the meaning of the connection locking mode.
- Sqlite
Operation - Sqlite
Synchronous - Refer to SQLite documentation for the meaning of various synchronous settings.
Traits§
- Sqlite
Executor - An alias for
Executor<'_, Database = Sqlite>.
Type Aliases§
- Sqlite
Pool - An alias for
Pool, specialized for SQLite. - Sqlite
Pool Options - An alias for
PoolOptions, specialized for SQLite. - Sqlite
Transaction - An alias for
Transaction, specialized for SQLite.