- SQLite date and time columns can be deserialized to/from strings.
- 🛠 Fixed an issue with
diesel_codegenon nightlies >= 2016-10-20
➕ Added partial support for composite primary keys.
➕ Added support for PostgreSQL
NULLS LASTwhen sorting. See https://docs.diesel.rs/diesel/prelude/trait.SortExpressionMethods.html for details.
➕ Added support for the
timestamp with time zonetype in PostgreSQL (referred to as
👀 Diesel CLI can now generate bash completion. See the readme for details.
infer_table_from_schema!can now take
dotenv!("foo"). The use of
diesel_codegen, which is included by default. Using
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.
Structs annotated with
#[derive(Associations)]. This is to allow them to work with Macros 1.1.
embed_migrations!now resolves paths relative to
Cargo.tomlinstead of the file the macro was called from. This change is required to allow this macro to work with Macros 1.1.
diesel migrations runwill now respect migration directories overridden by command line argument or environment variable
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)
#[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
- ⚡️ Updated nightly version and syntex support.
- 🚚 The
Copyconstraint has been removed from
#[belongs_to]now respects the
foreign_keyoption when using
- 🚚 The
The initial APIs have been added in the form of
#[belongs_to]. See [the module documentation][associations-module] for more information.
Insertable!macro can now be used instead of
#[insertable_into]for those wishing to avoid syntax extensions from
diesel_codegen. See https://docs.diesel.rs/diesel/macro.Insertable!.html for details.
Queryable!macro can now be used instead of
#[derive(Queryable)]for those wishing to avoid syntax extensions from
diesel_codegen. See https://docs.diesel.rs/diesel/macro.Queryable!.html for details.
Identifiable!macro can now be used instead of
#[derive(Identifiable)]for those wishing to avoid syntax extensions from
diesel_codegen. See https://docs.diesel.rs/diesel/macro.Identifiable!.html for details.
AsChangeset!macro can now be used instead of
#[changeset_for(table)]for those wishing to avoid syntax extensions from
diesel_codegen. See https://docs.diesel.rs/diesel/macro.AsChangeset!.html for details.
➕ Added support for the PostgreSQL
ALLoperator. See https://docs.diesel.rs/diesel/pg/expression/dsl/fn.all.html for details.
➕ Added support for
DELETEstatements. Implicitly these queries will use
🚀 Diesel now targets
nightly-2016-07-07. Future releases will update to a newer nightly version on the date that Rust releases.
diesel_codegenhas been split into two crates.
diesel_codegen_syntex. See this commit for migration information.
Most structs that implement
Queryablewill now also need
infer_schema!on SQLite now accepts a larger range of type names
types::VarCharis now an alias for
types::Text. Most code should be unaffected by this. PG array columns are treated slightly differently, however. If you are using
varchar, you should switch to
Struct fields annotated with
#[column_name="name"]should be changed to
👀 The structure of
DatabaseErrorhas changed to hold more information. See https://docs.diesel.rs/diesel/result/enum.Error.html and https://docs.diesel.rs/diesel/result/trait.DatabaseErrorInformation.html for more information
⚡️ Structs which implement
Identifiablecan now be passed to
delete. This means you can now write
📄 [associations-module]: https://docs.diesel.rs/diesel/associations/index.html
&&[T]can now be used in queries. This allows using slices with things like
- ➕ Added the
NotLike, to specify the escape character used in the pattern. See EscapeExpressionMethods for details.
diesel_clinow properly rely on Diesel 0.6.0. The restriction to 0.5.0 was an oversight.
infer_schema!now properly excludes metadata tables on SQLite.
infer_schema!now properly maps types on SQLite.
- ➕ Added the
Queries can now be boxed using the
into_boxed()method. This is useful for conditionally modifying queries without changing the type. See [BoxedDsl][boxed_dsl] for more details.
infer_schema!is now supported for use with SQLite3.
The maximum table size can be increased to 52 by enabling the
huge-tablesfeature. This feature will substantially increase compile times.
DISTINCTkeyword can now be added to queries via the
📄 [boxed_dsl]: https://docs.diesel.rs/diesel/prelude/trait.BoxedDsl.html
Sync. This required a change in the return type of
FromSqlto have those bounds as well.
It is no longer possible to pass an owned value to
insertwill now give a more helpful error message when you accidentally try to pass an owned value instead of a reference.
#[insertable_into]can now be used with structs that have lifetimes with names other than
Tables with a single column now properly return a single element tuple. E.g. if the column was of type integer, then
infer_schema!can now work with tables that have a primary key other than
- ✂ Removed the
no selectoption for the
table!macro. This was a niche feature that didn't fit with Diesel's philosophies. You can write a function that calls
selectfor you if you need this functionality.
- ⚡️ Updated
diesel_codegento allow syntex versions up to 0.30.0.
- ⚡️ Updated
Added helper function
diesel_manage_updated_at('TABLE_NAME')to postgres upon database setup. This function sets up a trigger on the specified table that automatically updates the
updated_atcolumn to the
current_timestampfor each affected row in
➕ Added support for explicit
UPDATEqueries. Implicitly these queries will still use
- ⚡️ Updated to work on nightly from early March
- ⚡️ Updated to work on nightly from late February