All Versions
62
Latest Version
Avg Release Cycle
91 days
Latest Release
563 days ago

Changelog History
Page 3

  • v1.1.1 Changes

    January 16, 2018

    ➕ Added

    • ➕ Added diesel::r2d2::PoolError as an alias for r2d2::Error. Previously this type was inaccessible due to diesel::r2d2::Error.
  • v1.1.0 Changes

    January 15, 2018

    ➕ 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.
  • v1.0.0 Changes

    January 02, 2018

    ➕ Added

    • #[derive(QueryableByName)] can now handle structs that have no associated table. If the #[table_name] annotation is left off, you must annotate each field with #[sql_type = "Integer"]

    • #[derive(QueryableByName)] can now handle embedding other structs. To have a field whose type is a struct which implements QueryableByName, rather than a single column in the query, add the annotation #[diesel(embed)]

    • The QueryDsl trait encompasses the majority of the traits that were previously in the query_dsl module.

    🛠 Fixed

    • Executing select statements on SQLite will no longer panic when the database returns SQLITE_BUSY

    • table!s which use the Datetime type with MySQL will now compile correctly, even without the chrono feature enabled.

    • #[derive(QueryableByName)] will now compile correctly when there is a shadowed Result type in scope.

    • BoxableExpression can now be used with types that are not 'static

    🔄 Changed

    • Connection::test_transaction now requires that the error returned implement Debug.

    • 🏗 query_builder::insert_statement::InsertStatement is now accessed as query_builder::InsertStatement

    • 🏗 query_builder::insert_statement::UndecoratedInsertRecord is now accessed as query_builder::UndecoratedInsertRecord

    • #[derive(QueryableByName)] now requires that the table name be explicitly stated.

    • 🚚 Most of the traits in query_dsl have been moved to query_dsl::methods. These traits are no longer exported in prelude. This should not affect most apps, as the behavior of these traits is provided by QueryDsl. However, if you were using these traits in where clauses for generic code, you will need to explicitly do use diesel::query_dsl::methods::WhateverDsl. You may also need to use UFCS in these cases.

    • If you have a type which implemented QueryFragment or Query, which you intended to be able to call execute or load on, you will need to manually implement RunQueryDsl for that type. The trait should be unconditionally implemented (no where clause beyond what your type requires), and the body should be empty.

    ✂ Removed

    • 🚚 All deprecated items have been removed.

    • 🚚 LoadDsl and FirstDsl have been removed. Their functionality now lives in LoadQuery.

  • v0.99.1 Changes

    December 01, 2017

    🔄 Changed

    • Diesel CLI now properly restricts its clap dependency. 0.99.0 mistakenly had no upper bound on the version.
  • v0.99.0 Changes

    November 28, 2017

    ➕ Added

    • ⚡️ The .for_update() method has been added to select statements, allowing construction of SELECT ... FOR UPDATE.

    • 0️⃣ Added insert_into(table).default_values() as a replacement for insert_default_values()

    • ➕ Added insert_into(table).values(values) as a replacement for insert(values).into(table).

    • ➕ Added support for MySQL's REPLACE INTO as replace_into(table).

    • ➕ Added replace_into(table).values(values) as a replacement for insert_or_replace(values).into(table).

    • Added on_conflict_do_nothing on InsertStatement as a replacement for on_conflict_do_nothing on Insertable structs.

    • ➕ Added on_conflict on InsertStatement as a replacement for on_conflict on Insertable structs.

    • ⚡️ filter can now be called on update and delete statements. This means that instead of update(users.filter(...)) you can write update(users).filter(...). This allows line breaks to more naturally be introduced.

    • Subselects can now reference columns from the outer table. For example, users.filter(exists(posts.filter(user_id.eq(users::id)))) will now compile.

    • TextExpressionMethods is now implemented for expressions of type Nullable<Text> as well as Text.

    • allow_tables_to_appear_in_same_query! can now take more than 2 tables, and is the same as invoking it separately for every combination of those tables.

    • ➕ Added sql_query, a new API for dropping to raw SQL that is more pleasant to use than sql for complete queries. The main difference from sql is that you do not need to state the return type, and data is loaded from the query by name rather than by index.

    • Added a way to rename a table in the table! macro with #[sql_name="the_table_name"]

    • ➕ Added support for PostgreSQL's DISTINCT ON. See .distinct_on() for more details

    🔄 Changed

    • The signatures of QueryId, Column, and FromSqlRow have all changed to use associated constants where appropriate.

    • You will now need to invoke allow_tables_to_appear_in_same_query! any time two tables appear together in the same query, even if there is a joinable! invocation for those tables.

    • diesel_codegen should no longer explicitly be used as a dependency. Unless you are using infer_schema! or embed_migrations!, you can simply remove it from your Cargo.toml. All other functionality is now provided by diesel itself.

    • Code using infer_schema! or infer_table_from_schema! must now add diesel_infer_schema to Cargo.toml, and #[macro_use] extern crate diesel_infer_schema to src/lib.rs

    • Code using embed_migrations! must now add diesel_migrations to Cargo.toml, and #[macro_use] extern crate diesel_migrations to src/lib.rs

    • 🚚 The migrations module has been moved out of diesel and into diesel_migrations

    🗄 Deprecated

    • 0️⃣ Deprecated insert_default_values() in favor of insert_into(table).default_values()

    • 🗄 Deprecated insert(values).into(table) in favor of insert_into(table).values(values).

    • Deprecated insert_or_replace(values).into(table) in favor of replace_into(table).values(values).

    • Deprecated .values(x.on_conflict_do_nothing()) in favor of .values(x).on_conflict_do_nothing()

    • Deprecated .values(x.on_conflict(y, do_nothing())) in favor of .values(x).on_conflict(y).do_nothing()

    • Deprecated .values(x.on_conflict(y, do_update().set(z))) in favor of .values(x).on_conflict(y).do_update().set(z)

    • Deprecated enable_multi_table_joins in favor of allow_tables_to_appear_in_same_query!

    • 🗄 Deprecated SqlLiteral#bind. sql is intended for use with small fragments of SQL, not complete queries. Writing bind parameters in raw SQL when you are not writing the whole query is error-prone. Use sql_query if you need raw SQL with bind parameters.

    ✂ Removed

    • 🚚 IntoInsertStatement and BatchInsertStatement have been removed. It's unlikely that your application is using these types, but InsertStatement is now the only "insert statement" type.

    • 🚚 Citext as a type alias for Text has been removed. Writing citext_column.eq("foo") would perform a case-sensitive comparison. More fleshed out support will be required.

    🛠 Fixed

    • When using MySQL and SQLite, dates which cannot be represented by chrono (such as 0000-00-00) will now properly return an error instead of panicking.

    • MySQL URLs will now properly percent decode the username and password.

    • References to types other than str and slice can now appear on structs which derive Insertable or AsChangeset.

    • Deserializing a date/time/timestamp column into a chrono type on SQLite will now handle any value that is in a format documented as valid for SQLite's strftime function except for the string 'now'.

  • v0.16.1

    May 27, 2018
  • v0.16.0 Changes

    August 24, 2017

    ➕ Added

    • ➕ Added helper types for inner join and left outer join

    • diesel::debug_query has been added as a replacement for debug_sql!. This function differs from the macro by allowing you to specify the backend, and will generate the actual query which will be run. The returned value will implement Display and Debug to show the query in different ways

    • diesel::pg::PgConnection, diesel::mysql::MysqlConnection, and diesel::sqlite::SqliteConnection are now exported from diesel::prelude. You should no longer need to import these types explicitly.

    • ➕ Added support for the Decimal datatype on MySQL, using the BigDecimal crate.

    • ➕ Added support for the [Range][range-0.16.0] type on postgreSQL.

    • ➕ Added support for the Datetime type on MySQL.

    • ➕ Added support for the Blob type on MySQL.

    • infer_schema! will now automatically detect which tables can be joined based on the presence of foreign key constraints.

    • ➕ Added support for Add and Sub to timestamp types.

    • Added a way to rename columns in the table macro with #[sql_name="the_column_name"]

    • 📚 Schema inference now also generates documentation comments for tables and columns. For infer_schema!, this is enabled by default. If you are using Diesel's CLI tool, pass the new --with-docs parameter: diesel print-schema --with-docs.

    • infer_schema! now automatically renames columns that conflict with a Rust keyword by placing a _ at the end of the name. For example, a column called type will be referenced as type_ in Rust.

    🔄 Changed

    • 🖨 The deprecated debug_sql! and print_sql! functions will now generate backend specific SQL. (The specific backend they will generate for will be arbitrarily chosen based on the backends enabled).

    • #[belongs_to] will no longer generate the code required to join between two tables. You will need to explicitly invoke joinable! instead, unless you are using infer_schema!

    • 🔄 Changed the migration directory name format to %Y-%m-%d-%H%M%S.

    • between and not_between now take two arguments, rather than a range.

    ✂ Removed

    • 🗄 debug_sql! has been deprecated in favor of diesel::debug_query.

    • 🗄 print_sql! has been deprecated without replacement.

    • 🚚 diesel::backend::Debug has been removed.

    🛠 Fixed

    • 👍 Diesel now properly supports joins in the form: grandchild.join(child.join(parent)). Previously only parent.join(child.join(grandchild)) would compile.

    • When encoding a BigDecimal on PG, 1.0 is no longer encoded as if it were 1.

    📄 [range-0.16.0]: https://docs.diesel.rs/diesel/pg/types/sql_types/struct.Range.html

  • v0.15.2 Changes

    July 28, 2017

    🛠 Fixed

    • BigDecimal now properly encodes numbers starting with 10000 on postgres. See issue #1044 for details.
  • v0.15.1 Changes

    July 24, 2017
    • No changes to public API
  • v0.15.0 Changes

    July 23, 2017

    ➕ Added

    • ➕ Added support for the PG IS DISTINCT FROM operator

    • 👀 The ON clause of a join can now be manually specified. See [the docs][join-on-dsl-0.15.0] for details.

    📄 [join-on-dsl-0.15.0]: https://docs.diesel.rs/diesel/prelude/trait.JoinOnDsl.html#method.on

    🔄 Changed

    • Diesel will now automatically invoke numeric_expr! for your columns in the common cases. You will likely need to delete any manual invocations of this macro.

    • Insertable no longer treats all fields as nullable for type checking. What this means for you is that if you had an impl like impl AsExpression<Nullable<SqlType>, DB> for CustomType in your code base, you can remove the Nullable portion (Unless you are using it with fields that are actually nullable)

    • Connections will now explicitly set the session time zone to UTC when the connection is established