diesel v0.16.0 Release Notes
Release Date: 2017-08-24 // over 6 years ago-
➕ Added
➕ Added helper types for inner join and left outer join
diesel::debug_query
has been added as a replacement fordebug_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 implementDisplay
andDebug
to show the query in different waysdiesel::pg::PgConnection
,diesel::mysql::MysqlConnection
, anddiesel::sqlite::SqliteConnection
are now exported fromdiesel::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
andSub
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 calledtype
will be referenced astype_
in Rust.
🔄 Changed
🖨 The deprecated
debug_sql!
andprint_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 invokejoinable!
instead, unless you are usinginfer_schema!
🔄 Changed the migration directory name format to
%Y-%m-%d-%H%M%S
.between
andnot_between
now take two arguments, rather than a range.
✂ Removed
🗄
debug_sql!
has been deprecated in favor ofdiesel::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 onlyparent.join(child.join(grandchild))
would compile.When encoding a
BigDecimal
on PG,1.0
is no longer encoded as if it were1
.
📄 [range-0.16.0]: https://docs.diesel.rs/diesel/pg/types/sql_types/struct.Range.html