For version 0.15.0 and above, see Releases page.
ToSql
implementation for time::Timespec
uses RFC 3339 (%Y-%m-%dT%H:%M:%S.%fZ). Previous format was %Y-%m-%d %H:%M:%S:%f %Z.Send
able and 'static
.free_boxed_hook
does not work for fn
.sqlite3_update_hook
(#260, #328), sqlite3_commit_hook
and sqlite3_rollback_hook
.unlock_notify
feature (#294, #331).Statement::column_index
case insensitive (#330).&mut Connection
in Transaction
.tyvar_behind_raw_pointer
warnings.Connection::open
documentation (#332)sqlite3_get_autocommit
and sqlite3_stmt_busy
.sqlite3_busy_timeout
and sqlite3_busy_handler
.sqlite3_expanded_sql
.rerun-if-env-changed
in libsqlite3-sys (#329).InvalidQuery
error when SQL is not read only.sqlcipher
feature allows linking against SQLCipher instead of SQLite.ToSql
impls for str
and [u8]
.FromSql
and ToSql
impls for isize
. Documents why usize
and u64
are not included.bundled
SQLite version to 3.17.0.bindgen
. This should improve build times and no longer require a new-ish Clang. See the README for more details.ErrorCode
enum from libsqlite3-sys
.version()
and version_number()
functions for querying the version of SQLite in use.limits
feature, exposing limit()
and set_limit()
methods on Connection
.libsqlite3-sys
0.7.0, which runs rust-bindgen at build-time instead of assuming the precense of all expected SQLite constants and functions.rusqlite::bypass_sqlite_initialization()
. This is technically a breaking change but is unlikely to affect anyone in practice, since prior to this version the check that rusqlite was using would cause a segfault if linked against a SQLite older than 3.7.0.rusqlite::bypass_sqlite_version_check()
.libc
dependency in favor of using std::os::raw
Clone
, Debug
, and PartialEq
to ToSqlOutput
.ToSqlOutput
itself implement ToSql
.FromSql
impl for i32
now returns an error instead of truncating if the underlying SQLite value is out of i32
's range.FromSql
and ToSql
impls for i8
, i16
, u8
, u16
, and u32
. i32
and i64
already had impls. u64
is omitted because their range cannot be represented by i64
, which is the type we use to communicate with SQLite.Connection::close()
now returns a Result<(), (Connection, Error)>
instead of a Result<(), Error>
so callers get the still-open connection back on failure.FromSql
trait has been redesigned. It now requires a single, safe method instead of the previous definition which required implementing one or two unsafe methods.ToSql
trait has been redesigned. It can now be implemented without unsafe
, and implementors can choose to return either borrowed or owned results.query_row
, query_row_and_then
, query_row_safe
, and query_row_named
now expects a &Row
instead of a Row
. The vast majority of calls to these functions will probably not need to change; see https://github.com/jgallagher/rusqlite/pull/184.Error
enum have sprouted additional information (e.g., FromSqlConversionFailure
now also includes the column index and the type returned by SQLite).#[deprecated(since = "...", note = "...")]
flags (new in Rust 1.9 for libraries) to all deprecated APIs.query_row
convenience function to Statement
.bundled
feature which will build SQLite from source instead of attempting to link against a SQLite that already exists on the system.DatabaseBusy
; see https://github.com/jgallagher/rusqlite/issues/186.insert()
convenience function when back-to-back inserts to different tables both returned the same row ID (#171).Rows
no longer implements Iterator
. It still has a next()
method, but the lifetime of the returned Row
is now tied to the lifetime of the vending Rows
object. This behavior is more correct. Previously there were runtime checks to prevent misuse, but other changes in this release to reset statements as soon as possible introduced yet another hazard related to the lack of these lifetime connections. We were already recommending the use of query_map
and query_and_then
over raw query
; both of theose still return handles that implement Iterator
.Transaction::savepoint()
now returns a Savepoint
instead of another Transaction
. Unlike Transaction
, Savepoint
s can be rolled back while keeping the current savepoint active.Connection
or savepoints from a Transaction
now take &mut self
instead of &self
to correctly represent that transactions within a connection are inherently nested. While a transaction is alive, the parent connection or transaction is unusable, so Transaction
now implements Deref<Target=Connection>
, giving access to Connection
's methods via the Transaction
itself.Transaction::set_commit
and Transaction::set_rollback
have been replaced by Transaction::set_drop_behavior
.Connection::prepare_cached
. Connection
now keeps an internal cache of any statements prepared via this method. The size of this cache defaults to 16 (prepare_cached
will always work but may re-prepare statements if more are prepared than the cache holds), and can be controlled via Connection::set_prepared_statement_cache_capacity
.query_map_named
and query_and_then_named
to Statement
.insert
convenience method to Statement
which returns the row ID of an inserted row.exists
convenience method returning whether a query finds one or more rows.serde_json
crate. Requires the serde_json
feature.chrono
crate. Requires the chrono
feature.load_extension
feature from libsqlite3-sys
. load_extension
is still available on rusqlite itself.trace
feature.clippy
feature and addresses issues it found.column_count()
method to Statement
and Row
.types::Value
for dynamic column types.functions
Cargo feature).RowIndex
trait allowing columns to be fetched via index (as before) or name (new).ZeroBlob
type under the blob
module/feature exposing SQLite's zeroblob API.handle()
method to Connection
. Please file an issue if you actually use it.SqliteError
is now an enum instead of a struct. Previously, we were (ab)using the error code and message to send back both underlying SQLite errors and errors that occurred at the Rust level. Now those have been separated out; SQLite errors are returned as SqliteFailure
cases (which still include the error code but also include a Rust-friendlier enum as well), and rusqlite-level errors are captured in other cases. Because of this change, SqliteError
no longer implements PartialEq
.SqliteTransactionDeferred
, SqliteTransactionImmediate
, and SqliteTransactionExclusive
are no longer exported. Instead, use TransactionBehavior::Deferred
, TransactionBehavior::Immediate
, and TransactionBehavior::Exclusive
.Sqlite
prefix on many types:SqliteConnection
is now Connection
SqliteError
is now Error
SqliteResult
is now Result
SqliteStatement
is now Statement
SqliteRows
is now Rows
SqliteRow
is now Row
SqliteOpenFlags
is now OpenFlags
SqliteTransaction
is now Transaction
.SqliteTransactionBehavior
is now TransactionBehavior
.SqliteLoadExtensionGuard
is now LoadExtensionGuard
. The old, prefixed names are still exported but are deprecated...._named
methods for executing queries using named placeholder parameters.backup
feature that exposes SQLite's online backup API.blob
feature that exposes SQLite's Incremental I/O for BLOB API.functions
feature that allows user-defined scalar functions to be added to open SqliteConnection
s.trace
feature that allows the use of SQLite's logging, tracing, and profiling hooks.query_map
and query_and_then
:'static
requirement on the closure's output type.&SqliteRow
instead of a SqliteRow
.SQLITE3_LIB_DIR
now takes precedence over pkg-config.pkg-config
is not available, we will try to find libsqlite3
in /usr/lib
.SqliteResult
s.libc
dependency to 0.2, fixing builds on ARM for Rust 1.6 or newer.Sized
bound to FromSql
trait as required by RFC 1214.get_opt
. Use get_checked
instead.query_row_and_then
and query_and_then
convenience functions. These are analogous to query_row
and query_map
but allow functions that can fail by returning Result
s.P: AsRef<...>
from &P
to P
.execute
when query
was intended.SqliteStatement
and SqliteConnection
.get_checked
to correctly indicate that it returns errors (not panics) when given invalid types or column indices.column_names()
to SqliteStatement
.SQLITE_OPEN_NO_MUTEX
and SQLITE_OPEN_URI
flags when opening a new conneciton.sqlite3_exec
was wrong).sqlite3_destructor_type
to define SQLITE_STATIC
and SQLITE_TRANSIENT
.query_row
to return a Result
instead of unwrapping.query_row_safe
(use query_row
instead).query_map
.get_checked
, which asks SQLite to do some basic type-checking of columns.stable
branch. Development continues on master
and still requires a nightly version of Rust.Send
.libc
crate).sqlite3_stmt
from libsqlite3-sys
for easier impl
-ing of ToSql
and FromSql
.open
now expects a Path
rather than a str
. There is a separate open_in_memory
constructor for opening in-memory databases.load_extension
Cargo feature, because not all builds of sqlite3 include this ability. Notably the default libsqlite3 that ships with OS X 10.10 does not support extensions.Error
trait for SqliteError
.query_row_safe
, a SqliteResult
-returning variant of query_row
.std::c_str
-> std::ffi
).sqlite3_busy_timeout
.std::vec::raw::from_buf
.time
crate.