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 on r2d2-diesel or r2d2. The functionality of both is exposed from diesel::r2d2.

    • r2d2::PooledConnection now implements Connection. This means that you should no longer need to write &*connection when using r2d2.

    • ๐Ÿ‘ 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 implement FromSql.

    • AsExpression can now be derived for types which implement ToSql.

    • HasSqlType, NotNull, and SingleValue can now be derived with #[derive(SqlType)]. See the docs for those traits for more information.

    • The return type of FromSql, FromSqlRow, and QueryableByName can now be written as deserialize::Result<Self>.

    • The return type of ToSql can now be written as serialize::Result.

    • โž• Added support for SQLite's INSERT OR IGNORE and MySQL's INSERT IGNORE via the insert_or_ignore function.

    • min and max can now be used with array expressions.

    • โž• Added diesel::dsl::array, which corresponds to a PG ARRAY[] literal.

    • โž• Added the not_none! macro, used by implementations of FromSql which do not expect NULL.

    • โž• Added result::UnexpectedNullError, an Error type indicating that an unexpected NULL was received during deserialization.

    • โž• Added .or_filter, which behaves identically to .filter, but using OR instead of AND.

    • helper_types now contains a type for every method defined in expression_methods, and every function in dsl.

    • Added FromSql impls for *const str and *const [u8] everywhere that String and Vec 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 another FromSql 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 adding default-features = false to Cargo.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 into sql_types, serialize, and deserialize.

    • query_source::Queryable and query_source::QueryableByName have been deprecated. These traits have been moved to deserialize.

    • ๐Ÿ“‡ backend::TypeMetadata has been deprecated. It has been moved to sql_types.

    • ๐Ÿ—„ types::ToSqlOutput has been deprecated. It has been renamed to serialize::Output.

    • helper_types::Not is now helper_types::not

    ๐Ÿ›  Fixed

    • infer_schema! generates valid code when run against a database with no tables.