mirror of
https://github.com/isar/rusqlite.git
synced 2024-11-23 00:39:20 +08:00
9.4 KiB
9.4 KiB
Version UPCOMING (...)
- BREAKING CHANGE: The
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. - Added
#[deprecated(since = "...", note = "...")]
flags (new in Rust 1.9 for libraries) to all deprecated APIs.
Version 0.7.2 (2016-05-19)
- BREAKING CHANGE:
Rows
no longer implementsIterator
. It still has anext()
method, but the lifetime of the returnedRow
is now tied to the lifetime of the vendingRows
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 ofquery_map
andquery_and_then
over rawquery
; both of theose still return handles that implementIterator
. - BREAKING CHANGE:
Transaction::savepoint()
now returns aSavepoint
instead of anotherTransaction
. UnlikeTransaction
,Savepoint
s can be rolled back while keeping the current savepoint active. - BREAKING CHANGE: Creating transactions from a
Connection
or savepoints from aTransaction
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, soTransaction
now implementsDeref<Target=Connection>
, giving access toConnection
's methods via theTransaction
itself. - BREAKING CHANGE:
Transaction::set_commit
andTransaction::set_rollback
have been replaced byTransaction::set_drop_behavior
. - Adds
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 viaConnection::set_prepared_statement_cache_capacity
. - Adds
query_map_named
andquery_and_then_named
toStatement
. - Adds
insert
convenience method toStatement
which returns the row ID of an inserted row. - Adds
exists
convenience method returning whether a query finds one or more rows. - Adds support for serializing types from the
serde_json
crate. Requires theserde_json
feature. - Adds support for serializing types from the
chrono
crate. Requires thechrono
feature. - Removes
load_extension
feature fromlibsqlite3-sys
.load_extension
is still available on rusqlite itself. - Fixes crash on nightly Rust when using the
trace
feature. - Adds optional
clippy
feature and addresses issues it found. - Adds
column_count()
method toStatement
andRow
. - Adds
types::Value
for dynamic column types. - Adds support for user-defined aggregate functions (behind the existing
functions
Cargo feature). - Introduces a
RowIndex
trait allowing columns to be fetched via index (as before) or name (new). - Introduces
ZeroBlob
type under theblob
module/feature exposing SQLite's zeroblob API. - Adds CI testing for Windows via AppVeyor.
- Fixes a warning building libsqlite3-sys under Rust 1.6.
- Adds an unsafe
handle()
method toConnection
. Please file an issue if you actually use it.
Version 0.6.0 (2015-12-17)
- BREAKING CHANGE:
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 asSqliteFailure
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 implementsPartialEq
. - BREAKING CHANGE: When opening a new detection, rusqlite now detects if SQLite was compiled or configured for single-threaded use only; if it was, connection attempts will fail. If this affects you, please open an issue.
- BREAKING CHANGE:
SqliteTransactionDeferred
,SqliteTransactionImmediate
, andSqliteTransactionExclusive
are no longer exported. Instead, useTransactionBehavior::Deferred
,TransactionBehavior::Immediate
, andTransactionBehavior::Exclusive
. - Removed
Sqlite
prefix on many types:SqliteConnection
is nowConnection
SqliteError
is nowError
SqliteResult
is nowResult
SqliteStatement
is nowStatement
SqliteRows
is nowRows
SqliteRow
is nowRow
SqliteOpenFlags
is nowOpenFlags
SqliteTransaction
is nowTransaction
.SqliteTransactionBehavior
is nowTransactionBehavior
.SqliteLoadExtensionGuard
is nowLoadExtensionGuard
. The old, prefixed names are still exported but are deprecated.
- Adds a variety of
..._named
methods for executing queries using named placeholder parameters. - Adds
backup
feature that exposes SQLite's online backup API. - Adds
blob
feature that exposes SQLite's Incremental I/O for BLOB API. - Adds
functions
feature that allows user-defined scalar functions to be added to openSqliteConnection
s.
Version 0.5.0 (2015-12-08)
- Adds
trace
feature that allows the use of SQLite's logging, tracing, and profiling hooks. - Slight change to the closure types passed to
query_map
andquery_and_then
:- Remove the
'static
requirement on the closure's output type. - Give the closure a
&SqliteRow
instead of aSqliteRow
.
- Remove the
- When building, the environment variable
SQLITE3_LIB_DIR
now takes precedence over pkg-config. - If
pkg-config
is not available, we will try to findlibsqlite3
in/usr/lib
. - Add more documentation for failure modes of functions that return
SqliteResult
s. - Updates
libc
dependency to 0.2, fixing builds on ARM for Rust 1.6 or newer.
Version 0.4.0 (2015-11-03)
- Adds
Sized
bound toFromSql
trait as required by RFC 1214.
Version 0.3.1 (2015-09-22)
- Reset underlying SQLite statements as soon as possible after executing, as recommended by http://www.sqlite.org/cvstrac/wiki?p=ScrollingCursor.
Version 0.3.0 (2015-09-21)
- Removes
get_opt
. Useget_checked
instead. - Add
query_row_and_then
andquery_and_then
convenience functions. These are analogous toquery_row
andquery_map
but allow functions that can fail by returningResult
s. - Relax uses of
P: AsRef<...>
from&P
toP
. - Add additional error check for calling
execute
whenquery
was intended. - Improve debug formatting of
SqliteStatement
andSqliteConnection
. - Changes documentation of
get_checked
to correctly indicate that it returns errors (not panics) when given invalid types or column indices.
Version 0.2.0 (2015-07-26)
- Add
column_names()
toSqliteStatement
. - By default, include
SQLITE_OPEN_NO_MUTEX
andSQLITE_OPEN_URI
flags when opening a new conneciton. - Fix generated bindings (e.g.,
sqlite3_exec
was wrong). - Use now-generated
sqlite3_destructor_type
to defineSQLITE_STATIC
andSQLITE_TRANSIENT
.
Version 0.1.0 (2015-05-11)
- [breaking-change] Modify
query_row
to return aResult
instead of unwrapping. - Deprecate
query_row_safe
(usequery_row
instead). - Add
query_map
. - Add
get_checked
, which asks SQLite to do some basic type-checking of columns.
Version 0.0.17 (2015-04-03)
- Publish version that builds on stable rust (beta). This version lives on the
stable
branch. Development continues onmaster
and still requires a nightly version of Rust.
Version 0.0.16
- Updates to track rustc nightly.
Version 0.0.15
- Make SqliteConnection
Send
.
Version 0.0.14
- Remove unneeded features (also involves switching to
libc
crate).
Version 0.0.13 (2015-03-26)
- Updates to track rustc nightly.
Version 0.0.12 (2015-03-24)
- Updates to track rustc stabilization.
Version 0.0.11 (2015-03-12)
- Reexport
sqlite3_stmt
fromlibsqlite3-sys
for easierimpl
-ing ofToSql
andFromSql
. - Updates to track latest rustc changes.
- Update dependency versions.
Version 0.0.10 (2015-02-23)
- BREAKING CHANGE:
open
now expects aPath
rather than astr
. There is a separateopen_in_memory
constructor for opening in-memory databases. - Added the ability to load SQLite extensions. This is behind the
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.
Version 0.0.9 (2015-02-13)
- Updates to track latest rustc changes.
- Implement standard
Error
trait forSqliteError
.
Version 0.0.8 (2015-02-04)
- Updates to track latest rustc changes.
Version 0.0.7 (2015-01-20)
- Use external bitflags from crates.io.
Version 0.0.6 (2015-01-10)
- Updates to track latest rustc changes (1.0.0-alpha).
- Add
query_row_safe
, aSqliteResult
-returning variant ofquery_row
.
Version 0.0.5 (2015-01-07)
- Updates to track latest rustc changes (closure syntax).
- Updates to track latest rust stdlib changes (
std::c_str
->std::ffi
).
Version 0.0.4 (2015-01-05)
- Updates to track latest rustc changes.
Version 0.0.3 (2014-12-23)
- Updates to track latest rustc changes.
- Add call to
sqlite3_busy_timeout
.
Version 0.0.2 (2014-12-04)
- Remove use of now-deprecated
std::vec::raw::from_buf
. - Update to latest version of
time
crate.
Version 0.0.1 (2014-11-21)
- Initial release