github diesel-rs/diesel v2.4.1
Diesel 2.4.1

one hour ago

Added

  • diesel print-schema now generates diesel::view! definitions for PostgreSQL materialized views when include_views is enabled
  • Added support for the jiff crate behind a new jiff feature, which is also part of extras. jiff::civil::Date, jiff::civil::Time and jiff::civil::DateTime map to the Date, Time and Timestamp SQL types on all backends (and jiff::civil::DateTime additionally to Datetime on MySQL and MariaDB), jiff::Timestamp maps to Timestamptz on PostgreSQL, and #[derive(MultiConnection)] supports the civil types

Fixed

  • #[derive(QueryableByName)] now respects #[sql_name] on table columns
  • Fix SSL mode for MariaDB feature.
  • AsyncPgConnection now maps the PostgreSQL connection exception codes that PgConnection reports as DatabaseErrorKind::ClosedConnection to the same kind
  • SqliteConnection now detects when SQLite rolls back the open transaction on its own (for example via ON CONFLICT ROLLBACK, RAISE(ROLLBACK, ...) or an I/O error) on every statement path. The transaction then stays open in Diesel and refuses every statement and commit with the new Error::TransactionRolledBackByDatabase until it is rolled back, so Connection::transaction returns the original error and nothing the closure runs afterwards is committed
  • diesel print-schema no longer treats a user-defined PostgreSQL type as a type provided by Diesel if it has the same name as one, like an enum named range, money or interval, or a domain named longtext that is selected by pg_domains_as_custom_types. Such types now get a definition in the sql_types module like any other custom type
  • Fixed a potential use after free bug related to ZEROFILL columns in the mysql backend if libmariadb is used and you reuse a result iterator after catching a panic.
  • Correctly validate the connection in the mobc connection handler in diesel-async
  • SqliteConnection now reports the error in InstrumentationEvent::FinishQuery when stepping through loaded rows fails, and emits FinishQuery with the error when binding the query parameters fails
  • SerializedDatabase::try_as_slice now returns the SQLite error (for example database is locked) instead of "out of memory" when SqliteConnection::serialize_database_to_buffer cannot read the database, and the Deref panic shows that error
  • Fixed diesel::view! incorrectly inferring a default primary key named id, which caused group_by queries selecting non-id columns on views with an id column to fail to compile
  • Fixed PostgreSQL bind numbering in #[derive(MultiConnection)] when a query fragment adds a bind after sql_query(..).bind(..), which could cause the query to return incorrect rows
  • SqliteConnection no longer prepares a cached statement again on each execution if the statement binds a value that the SQLite query planner uses, such as the LIMIT of first() and limit(). This was a performance regression in 2.4.0, visible with SQLite 3.54.1 and newer

The Diesel project is always looking for support. You can help by:

Full Changelog: v2.4.0...v2.4.1

Don't miss a new diesel release

NewReleases is sending notifications on new releases.