diesel v1.2.0 Release Notes
Release Date: 2018-04-06 // about 6 years ago-
➕ Added
➕ Added
SqlLiteral::bind()
. This is intended to be used for binding values to small SQL fragments. Usesql_query
if you are writing full queries.➕ Added support for
INSERT INTO table (...) SELECT ...
queries. Tables, select select statements, and boxed select statements can now be used just like any otherInsertable
value.Any insert query written as
insert_into(table).values(values)
can now be written asvalues.insert_into(table)
. This is particularly useful when inserting from a select statement, as select statements tend to span multiple lines.Diesel's derives can now produce improved error messages if you are using a nightly compiler, and enable the
unstable
feature. For the best errors, you should also setRUSTFLAGS="--cfg procmacro2_semver_exempt"
.➕ Added support for specifying
ISOLATION LEVEL
,DEFERRABLE
, andREAD ONLY
on PG transactions. See [PgConnection::build_transaction
] for details.
🏗 [
PgConnection::build_transaction
]: http://docs.diesel.rs/diesel/pg/struct.PgConnection.html#method.build_transaction- ➕ Added support for
BEGIN IMMEDIATE
andBEGIN EXCLUSIVE
on SQLite. See [SqliteConnection::immediate_transaction
] and [SqliteConnection::exclusive_transaction
] for details
📄 [
SqliteConnection::immediate_transaction
]: http://docs.diesel.rs/diesel/sqlite/struct.SqliteConnection.html#method.immediate_transaction 📄 [SqliteConnection::exclusive_transaction
]: http://docs.diesel.rs/diesel/sqlite/struct.SqliteConnection.html#method.exclusive_transaction👍 Tables with more than 56 columns are now supported by enabling the
128-column-tables
feature.✂ Delete statements can now be boxed. This is useful for conditionally modifying the where clause of a delete statement. See [
DeleteStatement::into_boxed
] for details.
📄 [
DeleteStatement::into_boxed
]: http://docs.diesel.rs/diesel/query_builder/struct.DeleteStatement.html#method.into_boxed- ⚡️ Update statements can now be boxed. This is useful for conditionally modifying
the where clause of a update statement. See [
UpdateStatement::into_boxed
] for details.
📄 [
UpdateStatement::into_boxed
]: http://docs.diesel.rs/diesel/query_builder/struct.UpdateStatement.html#method.into_boxed➕ Added
order_by
as an alias fororder
.Added
then_order_by
, which appends to anORDER BY
clause rather than replacing it. This is useful with boxed queries to dynamically construct an order by clause containing an unknown number of columns.#[derive(Insertable)]
can now work on structs with fields that implementInsertable
(meaning one field can map to more than one column). Add#[diesel(embed)]
to the field to enable this behavior.Queries that treat a subselect as a single value (e.g.
foo = (subselect)
) are now supported by calling [.single_value()
].#[derive(Insertable)]
implements nowInsertable
also on the struct itself, not only on references to the struct
📄 [
.single_value()
]: http://docs.diesel.rs/diesel/query_dsl/trait.QueryDsl.html#method.single_valueConnectionError
now implementsPartialEq
.0️⃣ Columns generated by
table!
now implementDefault
#[derive(AsChangeset)]
now implementsAsChangeset
on the struct itself, and not only on a reference to the struct➕ Added support for deserializing
Numeric
intoBigDecimal
on SQLite. SQLite has no arbitrary precision type, so the result will still have floating point rounding issues. This is primarily to support things likeavg(int_col)
, which we define as returningNumeric
🔄 Changed
The bounds on
impl ToSql for Cow<'a, T>
have been loosened to no longer require thatT::Owned: ToSql
.0️⃣
32-column-tables
are now enabled by default.
🗄 Deprecated
ne_any
has been renamed tone_all
.The
large-tables
feature has been has been renamed to32-column-tables
.The
huge-tables
feature has been renamed to64-column-tables
.⚡️
IncompleteUpdateStatement
has been removed. UseUpdateStatement
instead.
🛠 Fixed
diesel database setup
now correctly handles database URLs containing query stringsdiesel migration list
shows the proper migration order when mixing old and new timestamp formats. (The migrations were always run in the correct order, this only affects the display logic ofmigration list
)#[derive(Identifiable)]
now correctly associates#[primary_key]
with the column name, not field name.Select statements can no longer incorrectly appear in an expression context.
exists
can no longer incorrectly receive values other than select statements.MysqlConnection::establish
can now properly handle IPv6 addresses wrapped in square brackets.
Jokes
- Diesel is now powered by the blockchain because it's 2018.