diesel v0.8.0 Release Notes

Release Date: 2016-10-10 // over 7 years ago
  • ➕ Added

    • ➕ Added partial support for composite primary keys.

    • ➕ Added support for PostgreSQL NULLS FIRST and NULLS LAST when sorting. See https://docs.diesel.rs/diesel/prelude/trait.SortExpressionMethods.html for details.

    • ➕ Added support for the timestamp with time zone type in PostgreSQL (referred to as diesel::types::Timestamptz)

    • 👀 Diesel CLI can now generate bash completion. See the readme for details.

    • infer_schema! and infer_table_from_schema! can now take "env:foo" instead of env!("foo") and "dotenv:foo" instead of dotenv!("foo"). The use of dotenv requires the dotenv feature on diesel_codegen, which is included by default. Using env! and dotenv! will no longer work with diesel_codegen. They continue to work with diesel_codegen_syntex, but that crate will be deprecated when Macros 1.1 is in the beta channel for Rust.

    🔄 Changed

    • Structs annotated with #[has_many] or #[belongs_to] now require #[derive(Associations)]. This is to allow them to work with Macros 1.1.

    • embed_migrations! now resolves paths relative to Cargo.toml instead of the file the macro was called from. This change is required to allow this macro to work with Macros 1.1.

    🛠 Fixed

    • diesel migrations run will now respect migration directories overridden by command line argument or environment variable
    • The infer_schema! macro will no longer fetch views alongside with tables. This was a source of trouble for people that had created views or are using any extension that automatically creates views (e.g. PostGIS)

    🔄 Changed

    • #[changeset_for(foo)] should now be written as #[derive(AsChangeset)] #[table_name="foo"]. If you were specifying treat_none_as_null = "true", you should additionally have #[changeset_options(treat_none_as_null = "true")].
    • #[insertable_into(foo)] should now be written as #[derive(Insertable)] #[table_name="foo"].