Added
diesel print-schemanow generatesdiesel::view!definitions for PostgreSQL materialized views wheninclude_viewsis enabled- Added support for the
jiffcrate behind a newjifffeature, which is also part ofextras.jiff::civil::Date,jiff::civil::Timeandjiff::civil::DateTimemap to theDate,TimeandTimestampSQL types on all backends (andjiff::civil::DateTimeadditionally toDatetimeon MySQL and MariaDB),jiff::Timestampmaps toTimestamptzon PostgreSQL, and#[derive(MultiConnection)]supports the civil types
Fixed
#[derive(QueryableByName)]now respects#[sql_name]on table columns- Fix SSL mode for MariaDB feature.
AsyncPgConnectionnow maps the PostgreSQL connection exception codes thatPgConnectionreports asDatabaseErrorKind::ClosedConnectionto the same kindSqliteConnectionnow detects when SQLite rolls back the open transaction on its own (for example viaON 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 newError::TransactionRolledBackByDatabaseuntil it is rolled back, soConnection::transactionreturns the original error and nothing the closure runs afterwards is committeddiesel print-schemano longer treats a user-defined PostgreSQL type as a type provided by Diesel if it has the same name as one, like an enum namedrange,moneyorinterval, or a domain namedlongtextthat is selected bypg_domains_as_custom_types. Such types now get a definition in thesql_typesmodule like any other custom type- Fixed a potential use after free bug related to
ZEROFILLcolumns in the mysql backend iflibmariadbis used and you reuse a result iterator after catching a panic. - Correctly validate the connection in the
mobcconnection handler in diesel-async SqliteConnectionnow reports the error inInstrumentationEvent::FinishQuerywhen stepping through loaded rows fails, and emitsFinishQuerywith the error when binding the query parameters failsSerializedDatabase::try_as_slicenow returns the SQLite error (for exampledatabase is locked) instead of "out of memory" whenSqliteConnection::serialize_database_to_buffercannot read the database, and theDerefpanic shows that error- Fixed
diesel::view!incorrectly inferring a default primary key namedid, which causedgroup_byqueries selecting non-idcolumns on views with anidcolumn to fail to compile - Fixed PostgreSQL bind numbering in
#[derive(MultiConnection)]when a query fragment adds a bind aftersql_query(..).bind(..), which could cause the query to return incorrect rows SqliteConnectionno longer prepares a cached statement again on each execution if the statement binds a value that the SQLite query planner uses, such as theLIMIToffirst()andlimit(). 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:
- Contributing Code, Documentation, or Guides.
- Answering questions in our discussion forum
- Reporting bugs in our issue tracker
- Helping to triage issues in our issue tracker
- Sponsoring the maintainers.
- Filling out this survey about the current state and future developments of Diesel
Full Changelog: v2.4.0...v2.4.1