diesel v1.1.0 Release Notes
Release Date: 2018-01-15 // over 6 years ago-
โ Added
๐
r2d2-diesel
has been merged into Diesel proper. You should no longer rely directly onr2d2-diesel
orr2d2
. The functionality of both is exposed fromdiesel::r2d2
.r2d2::PooledConnection
now implementsConnection
. This means that you should no longer need to write&*connection
when usingr2d2
.๐ The
BINARY
column type name is now supported for SQLite.The
QueryId
trait can now be derived.FromSqlRow
can now be derived for types which implementFromSql
.AsExpression
can now be derived for types which implementToSql
.HasSqlType
,NotNull
, andSingleValue
can now be derived with#[derive(SqlType)]
. See the docs for those traits for more information.The return type of
FromSql
,FromSqlRow
, andQueryableByName
can now be written asdeserialize::Result<Self>
.The return type of
ToSql
can now be written asserialize::Result
.โ Added support for SQLite's
INSERT OR IGNORE
and MySQL'sINSERT IGNORE
via theinsert_or_ignore
function.min
andmax
can now be used with array expressions.โ Added
diesel::dsl::array
, which corresponds to a PGARRAY[]
literal.โ Added the
not_none!
macro, used by implementations ofFromSql
which do not expectNULL
.โ Added
result::UnexpectedNullError
, anError
type indicating that an unexpectedNULL
was received during deserialization.โ Added
.or_filter
, which behaves identically to.filter
, but usingOR
instead ofAND
.helper_types
now contains a type for every method defined inexpression_methods
, and every function indsl
.Added
FromSql
impls for*const str
and*const [u8]
everywhere thatString
andVec
are supported. These impls do not allocate, and are intended for use by other impls which need to parse a string or bytes, and don't want to allocate. These impls should never be used outside of anotherFromSql
impl.
๐ Deprecated
- IMPORTANT NOTE Due to [several][rust-deprecation-bug-1]
[bugs][rust-deprecation-bug-2] in Rust, many of the deprecations in this
release may not show a warning. If you want to ensure you are not using any
deprecated items, we recommend attempting to compile your code without the
with-deprecated
feature by addingdefault-features = false
toCargo.toml
.
๐ [rust-deprecation-bug-1]: https://github.com/rust-lang/rust/issues/47236 ๐ [rust-deprecation-bug-2]: https://github.com/rust-lang/rust/issues/47237
Deprecated
impl_query_id!
in favor of#[derive(QueryId)]
Deprecated specifying a column name as
#[column_name(foo)]
.#[column_name = "foo"]
should be used instead.๐ The
types
module has been deprecated. It has been split intosql_types
,serialize
, anddeserialize
.query_source::Queryable
andquery_source::QueryableByName
have been deprecated. These traits have been moved todeserialize
.๐
backend::TypeMetadata
has been deprecated. It has been moved tosql_types
.๐
types::ToSqlOutput
has been deprecated. It has been renamed toserialize::Output
.helper_types::Not
is nowhelper_types::not
๐ Fixed
infer_schema!
generates valid code when run against a database with no tables.