diesel
A safe, extensible ORM and Query Builder for PostgreSQL, SQLite, and MySQL
2.3.12
34M downloads/mo
#1567 most downloaded on crates.io
diesel-rs/diesel
What this package is like to depend on
Last release 16 days ago
07 Aug 2026
Ships on a steady schedule
a new release about every 5 weeks
Most releases are documented
notes for 82 of 93 stable releases
Nothing withdrawn
no release was ever pulled
11 years old
97 releases · first in 2015
13 releases in the last 12 months
see the full history below
Release timeline
97 releases · Nov 2015 to Aug 2026Releases
latest 60 of 97-
2.3.1207 Aug 2026Release notes
Open source →Fixes
- Fixed FromSql/ToSql for chrono::NaiveTime on MySQL dropping the fractional-seconds component of TIME values, so a TIME(N) column now round-trips its microseconds like DATETIME / TIMESTAMP already did.
- Extended libsqlite3-sys support to include 0.38
Full Changelog: v2.3.11...v2.3.12
You can support the development of Diesel by:
- Contributing Code, Documentation or Guides. Checkout the planing for Diesel 2.4 for open tasks.
- Providing knowledge and help to maintain the MySQL/MariaDB backend. This is currently the only in-tree backend that is not used by any maintainers, so having someone around that actually uses this backend would be very helpful for the Diesel project.
- Answering questions in our discussion forum
- Reporting bugs in our issue tracker
- Helping triaging issues in our issue tracker
- Sponsoring the maintainers.
Release notes
Open source →- Fixed FromSql/ToSql for chrono::NaiveTime on MySQL dropping the fractional-seconds component of TIME values, so a TIME(N) column now round-trips its microseconds like DATETIME / TIMESTAMP already did.
- Extended libsqlite3-sys support to include 0.38
-
2.3.1110 Jul 2026Release notes
Open source →Fixes
- Fixed several potential panics in PostgreSQL (de)serialization code
- Fixed using
.load()batch inserts and returning clauses on the SQLite backend - Harden usage of
SqliteConnection::deserialize_read_only_database()
Full Changelog: v2.3.10...v2.3.11
You can support the development of Diesel by:
- Contributing Code, Documentation or Guides. Checkout the planing for Diesel 2.4 for open tasks.
- Providing knowledge and help to maintain the MySQL/MariaDB backend. This is currently the only in-tree backend that is not used by any maintainers, so having someone around that actually uses this backend would be very helpful for the Diesel project.
- Answering questions in our discussion forum
- Reporting bugs in our issue tracker
- Helping triaging issues in our issue tracker
- Sponsoring the maintainers.
Release notes
Open source →- Fixed several potential panics in PostgreSQL (de)serialization code
- Fixed using
.load()batch inserts and returning clauses on the SQLite backend - Harden usage of
SqliteConnection::deserialize_read_only_database()
-
2.3.1005 Jun 2026Release notes
Open source →Fixes
- Fixed a wrong value of a internal MYSQL flag
- Fixed several possible panics in the PostgreSQL deserialization code for malformed packages in the
- Fixed an issue that caused unexpected results while calling custom aggregated SQL functions twice in the SQLite backend
- Fixed a potential use after free bug in the SQLite backend while deserializing a database from a byte buffer
- Fixed potential invalid schema generation if column or table names "inject" rust code
- Fixed potential SQL injections during schema introspection via
diesel print-schema - Fixed a regression that resulted in rejecting valid combinations of
ORDER BYandGROUP BYclauses
Full Changelog: v2.3.9...v2.3.10
You can support the development of Diesel by:
- Contributing Code, Documentation or Guides. Checkout the planing for Diesel 2.4 for open tasks.
- Providing knowledge and help to maintain the MySQL/MariaDB backend. This is currently the only in-tree backend that is not used by any maintainers, so having someone around that actually uses this backend would be very helpful for the Diesel project.
- Answering questions in our discussion forum
- Reporting bugs in our issue tracker
- Helping triaging issues in our issue tracker
- Sponsoring the maintainers.
Release notes
Open source →- Fixed a wrong value of a internal MYSQL flag
- Fixed several possible panics in the PostgreSQL deserialization code for malformed packages in the
- Fixed an issue that caused unexpected results while calling custom aggregated SQL functions twice in the SQLite backend
- Fixed a potential use after free bug in the SQLite backend while deserializing a database from a byte buffer
- Fixed potential invalid schema generation if column or table names "inject" rust code
- Fixed potential SQL injections during schema introspection via
diesel print-schema - Fixed a regression that resulted in rejecting valid combinations of
ORDER BYandGROUP BYclauses
-
2.3.930 Apr 2026Release notes
Open source →Fixed
- Removed a
dbg!statement from the Mysql backend that caused unwanted output - Fix a regression in
#[derive(AsChangeset)]introduced in 2.3.8 where structs with a type or const generic parameter referenced in a field type failed to compile witherror[E0425]: cannot find type 'T' in this scope. The diagnostic helper functions added to improveAsChangeseterror messages now forward all generic parameters of the input struct, not only lifetimes.
You can support the development of Diesel by:
- Contributing Code, Documentation or Guides. Checkout the planing for Diesel 2.4 for open tasks.
- Providing knowledge and help to maintain the MySQL/MariaDB backend. This is currently the only in-tree backend that is not used by any maintainers, so having someone around that actually uses this backend would be very helpful for the Diesel project.
- Answering questions in our discussion forum
- Reporting bugs in our issue tracker
- Helping triaging issues in our issue tracker
- Sponsoring the maintainers.
Release notes
Open source →- Removed a
dbg!statement from the Mysql backend that caused unwanted output - Fix a regression in
#[derive(AsChangeset)]introduced in 2.3.8 where structs with a type or const generic parameter referenced in a field type failed to compile witherror[E0425]: cannot find type 'T' in this scope. The diagnostic helper functions added to improveAsChangeseterror messages now forward all generic parameters of the input struct, not only lifetimes.
- Removed a
-
2.3.824 Apr 2026Release notes
Open source →Fixed
- Added support for libsqlite3-sys 0.37.0
- Raise a compile-time error when mixing aggregate and non-aggregate expressions in an
ORDER BYclause without aGROUP BYclause - Calling
.count()or.select(aggregate_expr)on a query that already has a non-aggregate.order_by()clause now raises a compile-time error instead of generating invalid SQL that would be rejected by the database at runtime (fixes #3815) - Added documentation for migration transaction behaviour at the crate root
- Improved compile time error messages for
#[derive(AsChangeset)] - Allow to use generic types in
infix_operator!() - Fixes for several instances of unsound, unspecified or otherwise dangerous behaviour:
- Unsound string construction in
SqliteValue::read_text/FromSql<Text, Sqlite> for String - Invalid alignment for over aligned data in
SqliteConnection::register_functionfor aggregate functions - Potential memory leaks in
SqliteConnection::register_function - Access to padding bytes while serializing Date/time types in the Mysql backend
- SQL Option Injection in PostgreSQL
COPY FROM/TO - Unspecified pointer cast in
Debug/Displayimplementation of batchINSERTstatements for SQLite - Invalid call order of SQLite API functions in
SqliteValue::read_text/FromSql<Text, Sqlite> for String/SqliteValue::read_blob()/FromSql<Binary, Sqlite> for Vec<u8> - Potential unsound pointer access for
FromSql<Binary, _> for Vec<u8>andFromSql<Text, _> for Stringfor third party backends (requires changes to the third party backend as well)
- Unsound string construction in
You can support the development of Diesel by:
- Contributing Code, Documentation or Guides. Checkout the planing for Diesel 2.4 for open tasks.
- Providing knowledge and help to maintain the MySQL/MariaDB backend. This is currently the only in-tree backend that is not used by any maintainers, so having someone around that actually uses this backend would be very helpful for the Diesel project.
- Answering questions in our discussion forum
- Reporting bugs in our issue tracker
- Helping triaging issues in our issue tracker
- Sponsoring the maintainers.
Full Changelog: v2.3.7...v2.3.8
Release notes
Open source →- Added support for libsqlite3-sys 0.37.0
- Raise a compile-time error when mixing aggregate and non-aggregate expressions in an
ORDER BYclause without aGROUP BYclause - Calling
.count()or.select(aggregate_expr)on a query that already has a non-aggregate.order_by()clause now raises a compile-time error instead of generating invalid SQL that would be rejected by the database at runtime (fixes #3815) - Added documentation for migration transaction behaviour at the crate root
- Improved compile time error messages for
#[derive(AsChangeset)] - Allow to use generic types in
infix_operator!() - Fixes for several instances of unsound, unspecified or otherwise dangerous behaviour:
- Unsound string construction in
SqliteValue::read_text/FromSql<Text, Sqlite> for String - Invalid alignment for over aligned data in
SqliteConnection::register_functionfor aggregate functions - Potential memory leaks in
SqliteConnection::register_function - Access to padding bytes while serializing Date/time types in the Mysql backend
- SQL Option Injection in PostgreSQL
COPY FROM/TO - Unspecified pointer cast in
Debug/Displayimplementation of batchINSERTstatements for SQLite - Invalid call order of SQLite API functions in
SqliteValue::read_text/FromSql<Text, Sqlite> for String/SqliteValue::read_blob()/FromSql<Binary, Sqlite> for Vec<u8> - Potential unsound pointer access for
FromSql<Binary, _> for Vec<u8>andFromSql<Text, _> for Stringfor third party backends (requires changes to the third party backend as well)
- Unsound string construction in
-
2.3.713 Mar 2026Release notes
Open source →Fixed
- Add support for libsqlite3-sys 0.36
- Fix a potential resource leak if establishing a SqliteConnection fails.
You can support the development of Diesel by:
- Contributing Code, Documentation or Guides. Checkout the planing for Diesel 2.4 for open tasks.
- Providing knowledge and help to maintain the MySQL/MariaDB backend. This is currently the only in-tree backend that is not used by any maintainers, so having someone around that actually uses this backend would be very helpful for the Diesel project.
- Answering questions in our discussion forum
- Reporting bugs in our issue tracker
- Helping triaging issues in our issue tracker
- Sponsoring the maintainers.
Full Changelog: v2.3.6...v2.3.7
Release notes
Open source →- Add support for libsqlite3-sys 0.36
- Fix a potential resource leak if establishing a SqliteConnection fails.
-
2.3.623 Jan 2026Release notes
Open source →Fixed
- Added support for mysqlclient-sys 0.5.0
- Fix generating valid schema if a column is named
table - Fixed a regression with
#[derive(Insertable)]if the same field type is used with different lifetime values
You can support the development of Diesel by:
- Contributing Code, Documentation or Guides. Checkout the planing for Diesel 2.4 for open tasks.
- Providing knowledge and help to maintain the MySQL/MariaDB backend. This is currently the only in-tree backend that is not used by any maintainers, so having someone around that actually uses this backend would be very helpful for the Diesel project.
- Answering questions in our discussion forum
- Reporting bugs in our issue tracker
- Helping triaging issues in our issue tracker
- Sponsoring the maintainers.
Full Changelog: v2.3.5...v2.3.6
Release notes
Open source →- Added support for mysqlclient-sys 0.5.0
- Fix generating valid schema if a column is named
table - Fixed a regression with
#[derive(Insertable)]if the same field type is used with different lifetime values
-
2.3.519 Dec 2025Release notes
Open source →Fixes
- Fix another libmariadb related issue with time types
- Improve compile time error messages for
#[derive(Insertable)] - Bump supported version of sqlite-wasm-rs to 0.5.0
- Minor documentation fixes
- Make the
returning_clauses_for_sqlite_3_35feature enable thesqlitefeature by default - Include a fix for a nightly rust name resolution ambiguity
You can support the development of Diesel by:
- Contributing Code, Documentation or Guides. Checkout the planing for Diesel 2.4 for open tasks.
- Providing knowledge and help to maintain the MySQL/MariaDB backend. This is currently the only in-tree backend that is not used by any maintainers, so having someone around that actually uses this backend would be very helpful for the Diesel project.
- Answering questions in our discussion forum
- Reporting bugs in our issue tracker
- Helping triaging issues in our issue tracker
- Sponsoring the maintainers.
Full Changelog: v2.3.4...v2.3.5
Release notes
Open source →- Fix another libmariadb related issue with time types
- Improve compile time error messages for
#[derive(Insertable)] - Bump supported version of sqlite-wasm-rs to 0.5.0
- Minor documentation fixes
- Make the
returning_clauses_for_sqlite_3_35feature enable thesqlitefeature by default - Include a fix for a nightly rust name resolution ambiguity
-
2.3.426 Nov 2025Release notes
Open source →Fixed
- Fix an issue with breaking changes in libmariadb
- Fix documentation links for helper types
- Fix using
#[diesel(embed)]withOption<Inner>types - Fix documentation for concurrent migration runs
You can support the development of Diesel by:
- Contributing Code, Documentation or Guides. Checkout the planing for Diesel 2.4 for open tasks.
- Providing knowledge and help to maintain the MySQL/MariaDB backend. This is currently the only in-tree backend that is not used by any maintainers, so having someone around that actually uses this backend would be very helpful for the Diesel project.
- Answering questions in our discussion forum
- Reporting bugs in our issue tracker
- Helping triaging issues in our issue tracker
- Sponsoring the maintainers.
Full Changelog: v2.3.3...v2.3.4
Release notes
Open source →- Fix an issue with breaking changes in libmariadb
- Fix documentation links for helper types
- Fix using
#[diesel(embed)]withOption<Inner>types - Fix documentation for concurrent migration runs
-
2.3.324 Oct 2025Release notes
Open source →Fixed
- Fix displaying binds in instrumentations for
#[derive(MultiConnection)] - Support artifact attestation for binaries build for releases
- Stop using absolute paths in generated diesel.toml
- Explicitly qualify
Okin code generated by derives to avoid naming conflicts
Starting with Diesel-CLI 2.3.3 you can verify that you downloaded the correct binaries via GitHub's artifact attestation
gh attestation verify diesel_cli-x86_64-unknown-linux-gnu.tar.xz -R diesel-rs/dieselFull Changelog: v2.3.2...v2.3.3
You can support the development of Diesel by:
- Contributing Code, Documentation or Guides. Checkout the planing for Diesel 2.4 for open tasks.
- Providing knowledge and help to maintain the MySQL/MariaDB backend. This is currently the only in-tree backend that is not used by any maintainers, so having someone around that actually uses this backend would be very helpful for the Diesel project.
- Answering questions in our discussion forum
- Reporting bugs in our issue tracker
- Helping triaging issues in our issue tracker
- Sponsoring the maintainers.
Release notes
Open source →Fixed
- Fix displaying binds in instrumentations for
#[derive(MultiConnection)] - Support artifact attestation for binaries build for releases
- Stop using absolute paths in generated diesel.toml
- Explicitly qualify
Okin code generated by derives to avoid naming conflicts
- Fix displaying binds in instrumentations for
-
2.3.219 Sep 2025Release notes
Open source →Fixed
- Fixed an incompatibility with libmariadb versions shipped by debian
- Fixed docs.rs builds
- Fixed applying patch file schema.rs file with formatting
- Allow to compare DatabaseErrorKind values
-
2.3.112 Sep 2025Release notes
Open source →This version did not contain any changes, but only a version bump to retrigger the docs.rs build
-
2.3.012 Sep 2025Release notes
Open source →Added
- Added
limit()andoffset()DSL to combination clauses such asUNION - Fixed
#[derive(Identifiable)]ignoring attribute#[diesel(serialize_as)]on primary keys - Added embedded struct support for
AsChangesetvia#[diesel(embed)] - Added a
#[diesel(skip_update)]attribute for theAsChangesetderive to skip updating a field present in the struct - Support for libsqlite3-sys 0.35.0
- Add support for built-in PostgreSQL range operators and functions
- Support for postgres multirange type
- Added
diesel::r2d2::TestCustomizer, which allows users to customize theirdiesel::r2d2::Pools in a way that makes the pools suitable for use in parallel tests. - Added support for built-in PostgreSQL range operators and functions
- Added support for various built-in PostgreSQL array functions
- Added
JsonandJsonbsupport for the SQLite backend. - Added a
#[diesel::declare_sql_function]attribute macro to easily define support for multiple sql functions at once via anextern "SQL"block - Support
[print_schema] allow_tables_to_appear_in_same_query_config = "fk_related_tables"to generate separateallow_tables_to_appear_in_same_query!calls containing only tables that are related through foreign keys. (Default:"all_tables".) It is not possible to build queries using two tables that don't appear in the sameallow_tables_to_appear_in_same_query!call, but that macro generates O(n²) rust code, so this option may be useful to reduce compilation time. (#4333) - Added
wasm32-unknown-unknowntarget support for sqlite backend. - Add support for the
CASToperator - Support
[print_schema] allow_tables_to_appear_in_same_query_config = "none"to generate noallow_tables_to_appear_in_same_query!calls. (Default:"all_tables".). (#4333) - Add
[print_schema] pg_domains_as_custom_typesparameter to generate custom types for PostgreSQL domains that matches any of the regexes in the given list. (Default:[].) This option allows an application to selectively give special meaning for the serialization/deserialization of these types, avoiding the default behavior of treating the domain as the underlying type. (#4592) - Add support for batch insert and upsert statements with returning for SQLite
- Add support for window functions and aggregate expressions.
Fixed
- Fixed diesel thinking
a.eq_any(b)was non-nullable even ifaandbwere nullable. - Generate
InstrumentationEvent::BeginTransactionfor immediate and exclusive transactions in SQLite - Use a single space instead of two spaces between
DELETE FROM. - Diesel CLI now ensures that migration versions are always unique. If it fails to generate a unique version, it will return an error. The new version format remains compatible with older Diesel versions.
- Updated
ipnetworkto allow version 0.21.
Changed
- Use distinct
DIESEL_LOGlogging filter env variable instead of the defaultRUST_LOGone (#4575) - The minimal supported Rust version is now 1.86.0
- Added
-
2.2.1211 Jul 2025Nothing published for this version
-
2.2.1118 Jun 2025Nothing published for this version
-
2.2.1025 Apr 2025Nothing published for this version
-
2.2.904 Apr 2025Release notes
Open source →Fixed
- Fix an issue where
diesel migration generate --diff-schemaincorrectly uses the primary key of table B as the referenced column rather than the primary key of table A when B has a foreign key pointing to table A. - Bump maximal supported libsqlite3-sys version to 0.32.0 and add explicit feature entries for the
uuidandserde_jsonfeature. - Fixed an issue where diesel generated unnamed prepared statements would fail with an
unanmed prepared statement not founderror with pgbouncer. - Fix an issue with converting
ipnet::Ipnetvalues with an subnet to SQL values
- Fix an issue where
-
2.2.803 Mar 2025Release notes
Open source →Fixed
- Allow
#[diesel(check_for_backend(_))]to check fields with#[diesel(embed)]annotations - Improve custom compile error message around
CompatibleType - Fix a bug that restricted the number of allowed columns in
COPY FROMstatements to 12 - Expose some SqliteValue helper functions
- Use consistent whitespace in
ASC/DESC,DISTINCT ON, andDELETE FROMclauses
- Allow
-
2.2.731 Jan 2025Release notes
Open source →Fixed
- Fixed diesel thinking
a.eq_any(b)was non-nullable even ifaandbwere nullable. - Generate
InstrumentationEvent::BeginTransactionfor immediate and exclusive transactions in SQLite - Minimize the amount of duplicated code generated for
diesel::debug_query - Updated
ipnetworkto allow version 0.21. - Updated
libsqlite3-systo allow version 0.31.0 - Updated
pq-systo allow version 0.7.0 - Add support for numeric operators (+-*/) in
#[diesel::auto_type] - Add support for joins to sub-jons to aliases
- Fixed diesel thinking
-
2.2.603 Dec 2024 -
2.2.521 Nov 2024Release notes
Open source →Fixed
- Add a typedef for
ReturningandCountso that#[auto_type]works with such queries - Fixed an issue that allowed to pass non-boolean expressions to
.and()and.or()which would result in queries failing at runtime - Officially deprecating the gitter room
Removed
- Do not mention the gitter channel in our docs anymore
- Add a typedef for
-
2.2.403 Sep 2024Release notes
Open source →Fixed
- Fix an issue where empty queries could trigger undefined behaviour in the sqlite backend
-
2.2.323 Aug 2024Release notes
Open source →Fixed
- Support for libsqlite3-sys 0.30.0
- Fixed a possible vulnerability in how Diesel handled protocol level bind parameters. See the SQL Injection isn't Dead: Smuggling Queries at Protocol Level presentation from DEF CON for details
- Fixed an issue with a possibly ambiguous trait resolution in
#[derive(QueryableByName)]
-
2.2.219 Jul 2024Release notes
Open source →Fixed
- Support for libsqlite3-sys 0.29.0
- Fixed a potential panic in the sqlite cursor implementation
- Fixed support for rust numeric operators with columns of the type
Numeric - Removed the
SerializedDatabase::newfunction due to unsoundness
-
2.2.113 Jun 2024Nothing published for this version
-
2.2.031 May 2024Release notes
Open source →Added
- Support
[print_schema] except_custom_type_definitions = ["Vector"]. If acustom typematches one element on the list it's skipped. - Added automatic usage of all sqlite
rowidaliases when no explicit primary key is defined forprint-schema - Added a
#[dsl::auto_type]attribute macro, allowing to infer type of query fragment functions - Added the same type inference on
Selectablederives, which allows skipping specifyingselect_expression_typemost of the time, in turn enabling most queries to be written using just aSelectablederive. - Added an optional
#[diesel(skip_insertion)]field attribute to theInsertablederive macro, allowing fields which map to generated columns to be skipped during insertion. - Support for connection instrumentation. This allows to inspect any query run by your application
- Logging in diesel-cli
- Support for libsqlite3-sys 0.28
- Add
sqlite-integer-primary-key-is-bigintconfiguration option, usable with SQLite 3.37 or above, allowing to useBigIntforINTEGER PRIMARY KEYcolumns in SQLite for tables without theWITHOUT ROWIDattribute (SQLite doc). - Support for multiple
print_schemaentry indiesel.toml(e.g.[print_schema.user1]), which allows generating multiple schema.rs files - Add support for
COPY TOandCOPY FROMstatements - Add support for mapping
chrono::Durationto postgresql'sINTERVALsql type - Added
serialize_database_to_bufferanddeserialize_readonly_database_from_buffermethods inSqliteConnectionto support serialization/deserialization of SQLite databases to and from byte buffers. - Added
SerializedDatabasewrapper type for a serialized database that is dynamically allocated by callingserialize_database_to_buffer. This RAII wrapper deallocates the memory when it goes out of scope withsqlite3_free.
Changed
- The minimal officially supported rustc version is now 1.78.0
- Deprecated
sql_function!in favour ofdefine_sql_function!which provides compatibility with#[dsl::auto_type] - Deserialization error messages now contain information about the field that failed to deserialize
- Support
-
2.1.619 Apr 2024Release notes
Open source →- Fix using
BoxableExpressionwith having clauses - Fix using numeric expressions with aliased fields
- Minor documentation fixes
- Fix using
-
2.1.515 Mar 2024Release notes
Open source →- Fix
impl SqlOrdpostgres > postgres_backend feature flag. - Allow
Queryableto be used with multiple table names. - Fix an inconsistent unit test
- Fix a clippy lint
- Fix ./bin/test feature flag calls.
- Update
libsqlite3-systo allow version 0.28 as well
- Fix
-
2.1.414 Nov 2023 -
2.1.305 Oct 2023Release notes
Open source →- Increased accidentally decreased limit around element count in
DISTINCT ONandORDER BYclauses again as that broke existing code
- Increased accidentally decreased limit around element count in
-
2.1.225 Sep 2023Nothing published for this version
-
2.1.125 Aug 2023Nothing published for this version
-
2.1.026 May 2023Release notes
Open source →Changed
- The minimal officially supported rustc version is now 1.65.0
Added
- Added the
custom_type_derivesconfig option to customize the derives for SQL type definitions automatically generated by Diesel CLI. - Add a
#[derive(MultiConnection)]proc-macro that lets you easily implementdiesel::Connectionfor an enum of connections to different database backends. - Added a
--diff-schemaflag to thediesel migration generatecommand that generates a migration based on the difference between your database and the providedschema.rsfile - Add a
ON CONFLICT (...) DO UPDATE ... [WHERE ...]conditional clause support for PostgreSQL. - Add support for MySQL's
ON DUPLICATE KEY DO UPDATEsyntax through the existing upsert functions. - Add ability to define multiple columns in a single
distinct_onfor PostgreSQL, like:.distinct_on((column_a, column_b)). - Added column size restrictions to the generated
schema.rsfile
-
2.0.418 Apr 2023Nothing published for this version
-
2.0.324 Jan 2023Nothing published for this version
-
2.0.211 Oct 2022Release notes
Open source →Fixed
- Reverted a fix from the 2.0.1 release that breaks valid
INSERT … ON CONFLICTqueries
- Reverted a fix from the 2.0.1 release that breaks valid
-
2.0.107 Oct 2022Release notes
Open source →Fixed
- Fixed an issue with
diesel_cligenerating incompatible type names for thegenerate_missing_sql_type_definitionsfeature on PostgreSQL - Fixed an issue how
diesel_clihandles sqlite urls while checking if a given database exists - Fixed an issue with
PgConnectionbecoming unusable after hitting a database error in certain situations - Fixed an issue with diesel generating invalid SQL for certain
INSERT … ON CONFLICTqueries - Fixed
diesel_derivesgenerating code that triggers the disabled by defaultunused_qualificationslint
- Fixed an issue with
-
2.0.029 Aug 2022Release notes
Open source →Added
-
MysqlConnection::establishis able to initiate an SSL connection while specifying certificate roots. The database URL should contain anssl_caparameter with a path pointing to the certificate roots. See docs if desired. -
MysqlConnection::establishis able to initiate an SSL connection. The database URL should containssl_modeparameter with a value of the MySQL client command option--ssl-modeif desired. -
ConnectionandSimpleConnectiontraits are implemented for a broader range ofr2d2::PooledConnection<M>types when ther2d2feature is enabled. -
Added
DatabaseErrorKind::ReadOnlyTransactionto allow applications to handle errors caused by writing when only allowed to read. -
All expression methods can now be called on expressions of nullable types.
-
Added
BoxedSqlQuery. This allows users to do a variable amount of.sqlor.bindcalls without changing the underlying type. -
Added
.sqltoSqlQueryandUncheckedBindto allow appending SQL code to an existing query. -
The
MacAddrSQL type can now be used without enabling thenetwork-addressfeature. -
Added support for SQLite's
UPSERT. You can use this feature above SQLite version 3.24.0. -
Added ability to create custom aggregate functions in SQLite.
-
Multiple aggregate expressions can now appear together in the same select clause. See the upgrade notes for details.
-
ValidGroupinghas been added to represent whether an expression is valid for a given group by clause, and whether or not it's aggregate. It replaces the functionality ofNonAggregate. See the upgrade notes for details. -
It is now possible to inspect the type of values returned from the database in such a way to support constructing a dynamic value depending on this type.
-
Added a
without-deprecatedfeature that unconditionally disables deprecated items. Use this feature flag to verify that none of your dependencies is setting thewith-deprecatedflag internally. -
Added support for PostgreSQL's
SIMILAR TOandNOT SIMILAR TO. -
Added
#[diesel(serialize_as)]analogous to#[diesel(deserialize_as)]. This allows customization of the serialization behaviour ofInsertableandAsChangesetstructs. -
Added support for
GROUP BYclauses -
Added support for
UNION,UNION ALL,INTERSECT,INTERSECT ALL,EXCEPT,EXCEPT ALLclauses -
Added the error position for PostgreSQL errors
-
Added ability to create custom collation functions in SQLite.
-
Added support for SQLite's
ISandIS NOT. -
Add support for HAVING clauses.
-
Added support for SQL functions without arguments for SQLite.
-
Diesel CLI will now generate SQL type definitions for SQL types that are not supported by diesel out of the box. It's possible to disable this behavior via the
generate_missing_sql_type_definitionsconfig option. -
Added an option to
#[derive(Insertable)]that let you insertNULLvalues instead ofDEFAULTvalues forOption<T> -
Added support for all the derive attributes being inside
#[diesel(...)] -
Added support for
RETURNINGexpressions for Sqlite via thereturning_clauses_for_sqlite_3_35feature -
Added support for table aliasing via the
alias!macro -
Added support for the usage of slices of references with
belonging_tofromBelongingToDsl -
Added support for updating individual array elements
UPDATE table SET array_column[1] = true -
Adds an
ipnet-addressfeature flag, allowing support (de)serializing IP values from the database using types provided byipnet. This feature may be enabled concurrently with the previously existingnetwork-addressfeature. -
We've added support for loading values using libpq's row-by-row mode via the new iterator interface
-
Adds
Timestamp,Timestamptzsupport for appropriate types fortime v0.3.9. This feature enables using thetimecrate as an alternative tochrono.
Removed
- All previously deprecated items have been removed.
- Support for
uuidversion < 0.7.0 has been removed. - Support for
bigdecimal< 0.0.13 has been removed. - Support for
pq-sys< 0.4.0 has been removed. - Support for
mysqlclient-sys< 0.2.5 has been removed. - Support for
time(0.1) types has been removed. - Support for
chrono< 0.4.19 has been removed. - The minimal supported version of libsqlite3-sys is now 0.17.2.
- The
NonNulltrait for sql types has been removed in favour of the newSqlTypetrait. no_arg_sql_function!has been deprecated without replacement. [sql_function!][sql-function-2-0-0] can now be used for functions with zero arguments. See the migration guide for more details.- Support for
barrelbased migrations has been removed for now. We are happy to add this support back as soon asbarrelintegrates with our new migration framework. - The deprecated bash completions command (
diesel bash-completions) has been removed. Usediesel completions <shell>instead.
Changed
-
The minimal officially supported rustc version is now 1.56.0
-
Interacting with a database requires a mutable connection.
-
The way the
Backendtrait handles itsRawValuetype has been changed to allow non-references. Users of this type (e.g. code written&DB::RawValueor&<DB as Backend>::RawValue>) should usebackend::RawValue<DB>instead. Implementors ofBackendshould check the relevant section of the migration guide.
-
The type metadata for MySQL has been changed to include sign information. If you are implementing
HasSqlTypeforMysqlmanually, you may need to adjust your implementation to fully use the new unsigned variants inMysqlType -
The
RawValuetypes for theMysqlandPostgresqlbackend where changed from[u8]to distinct opaque types. If you used the concreteRawValuetype somewhere you need to change it tomysql::MysqlValueorpg::PgValue. -
The
uuidv07feature was renamed touuid, due to the removal of support for older uuid versions -
Boxed queries (constructed from
.into_boxed()) are nowSend. -
The handling of mixed aggregate values is more robust. Invalid queries such as
.select(max(id) + other_column)are now correctly rejected, and valid queries such as.select((count_star(), max(other_column)))are now correctly accepted. For more details, see the migration guide. -
NonAggregateis now a trait alias forValidGrouping<()>for expressions that are not aggregate. On stable this is a normal trait with a blanket impl, but it should never be implemented directly. With theunstablefeature, it will use trait aliases which prevent manual implementations.Due to language limitations, we cannot make the new trait alias by itself represent everything it used to, so in some rare cases code changes may be required. See the migration guide for details.
-
Various
__NonExhaustivevariants in different (error-) enums are replaced with#[non_exhaustive]. If you matched on one of those variants explicitly you need to introduce a wild card match instead. -
FromSql::from_sqlis changed to construct value from non nullable database values. To construct a rust value for nullable values use the newFromSql::from_nullable_sqlmethod instead. -
Custom sql types are now required to implement the new
SqlTypetrait. Diesel will automatically create implementations of that trait for all types having a#[derive(SqlType)] -
The workflow for manually implementing support custom types has changed. Implementing
FromSqlRow<ST, DB>is not required anymore, as this is now implied by implementingFromSql<ST, DB>. The requirement of implementingQueryable<ST, DB>remains unchanged. For types using#[derive(FromSqlRow)]no changes are required as the derive automatically generates the correct code -
The structure of our deserialization trait has changed. Loading values from the database requires now that the result type implements
FromSqlRow<ST, DB>. Diesel provides wild card implementations for types implementingQueryable<ST, DB>orQueryableByName<DB>so non generic code does not require any change. For generic code you likely need to replace a trait bound onQueryable<ST, DB>with a trait bound onFromSqlRow<ST, DB>and a bound toQueryableByName<DB>withFromSqlRow<Untyped, DB>. -
CLI flags of
only-tablesandexcept-tablesare now interpreted as regular expressions. Similarly,only_tablesandexcept_tablesindiesel.tomlare treated as regular expressions. -
Now you can sort column fields by name with the
column-sortingoption. It can be set to eitherordinal_position(default) orname. This ensures stable sorting even if columns are removed and re-added. -
The
Queryable<ST,DB>trait was updated to be made faillible, in order to properly handle cases where you detect a data inconsistency between fields on deserialization (that e.g. was supposed to be made impossible by DBCHECKs). Thebuildfunction now returns adiesel::deserialize::Result<Self>instead of aSelf. -
TypeMetadata::MetadataLookupis now?Sized. -
Multiple implementations of
Connection<Backend=Pg>are now possible because of the newPgMetadataLookuptrait. -
For the
Pgbackend,TypeMetadata::MetadataLookuphas changed todyn PgMetadataLookup. -
Diesel's migration framework was rewritten from the ground. Existing migrations continue to be compatible with the rewrite, but code calling into
diesel_migrationsrequires an update. See the migration guide for details. -
eq_any()now emits a= ANY()expression for the postgresql backend instead ofIN() -
ne_all()now emits a!= ALL()expression for the postgresql backend instead ofNOT IN() -
The sqlite backend now uses a single batch insert statement if there are now default values present in the values clause
-
The MySQL connection is using the CLIENT_FOUND_ROWS from now on. This means that updating rows without changing any values will return the number of matched rows (like most other SQL servers do), as opposed to the number of changed rows.
-
The definition of
ToSql::to_sqlandQueryFragment::walk_asthas changed to allow serializing values without copying the value itself. This is useful for database backends like sqlite where you can directly share a buffer with the database. Beside of the changed signature, existing impls of this trait should remain unchanged in almost all cases. -
The
PIPES_AS_CONCATsql_mode is no longer set by default. This setting requires a modification to MySQL query parsing that is not supported by certain systems (such as Vitess). If you are using MySQL and executing raw queries with the||operator, you will need to rewrite your queries or setPIPES_AS_CONCATmanually.
Fixed
-
Many types were incorrectly considered non-aggregate when they should not have been. All types in Diesel are now correctly only considered non-aggregate if their parts are.
-
Offset clauses without limit clauses resulted into invalid sql using the mysql or sqlite backend. Both do not support such clauses without a preceding limit clause. For those backend Diesel does now generate a fake limit clause in case no explicit limit clause was given. As consequence of this change generic query code may require additional trait bounds as requested from the compiler. Third party backends are required to explicitly provide
QueryFragmentimpls forLimitOffsetClause<L, O>now. -
Nullability requirements are now properly enforced for nested joins. Previously, only the rules for the outer-most join were considered. For example,
users.left_join(posts).left_join(comments)would allow selecting any columns fromposts. That will now fail to compile, and any selections frompostswill need to be made explicitly nullable. -
Diesel CLI will now look for
diesel.tomlto determine the project root before looking forCargo.toml. -
Any relative paths in
diesel.tomlwill now be treated as relative to the project root (the directory containing eitherdiesel.tomlorCargo.toml). They are no longer dependent on the current working directory (for all directories in the same project) -
The SQLite backend is now configured to interpret URIs. See the SQLite URI documentation for additional details.
-
We've refactored our type translation layer for Mysql to handle more types now.
-
We've refactored our type level representation of nullable values. This allowed us to fix multiple long standing bugs regarding the correct handling of nullable values in some corner cases (#104, #2274)
-
Parenthesis are now inserted around all infix operations provided by diesel's
ExpressionMethodstraits -
Queries containing a
distinct onclause check now on compile time that a compatible order clause was set. -
Implementations of custom SQLite SQL functions now check for panics
-
diesel print-schemanow generatesArray<Nullable<ST>>rather thanArray<ST>for Postgres Array types. Existence ofNULLvalues in database arrays would previously result in deserialization errors. Non-nullable arrays are now opt in (by schema patching).
Deprecated
-
All the diesel derive attributes that are not inside
#[diesel(...)] -
diesel_(prefix|postfix|infix)_operator!have been deprecated. These macros are now available without thediesel_prefix. With Rust 2018 they can be invoked asdiesel::infix_operator!instead. -
diesel::pg::upserthas been deprecated to support upsert queries on more than one backend. Please usediesel::upsertinstead. -
diesel::dsl::anyanddiesel::dsl::allare now deprecated in favour ofExpressionMethods::eq_any()andExpressionMethods::ne_all()
-
-
2.0.0-rc.122 Jul 2022 pre-releaseNothing published for this version
-
2.0.0-rc.022 Apr 2022 pre-releaseNothing published for this version
-
1.4.820 Sep 2021Release notes
Open source →Fixed
- Fixed a incompatibly between
dieselanddiesel_migrationswhen building both crates with cargos newresolver = "2"enabled. This change ensures compatibility with the upcoming 2021 rust edition.
- Fixed a incompatibly between
-
1.4.708 Jun 2021Release notes
Open source →Fixed
- Updated
libsqlite3-systo allow version 0.22 - Updated
ipnetworkto allow version 0.18
- Updated
-
1.4.605 Mar 2021Release notes
Open source →Fixed
- Fixed a use-after-free issue in the
QueryableByNameimplementation of ourSqlitebackend - Updated several dependencies
- Fixed a use-after-free issue in the
-
1.4.509 Jun 2020Release notes
Open source →Fixed
- Update several dependencies
- Fixed an issue where transactions that would fail to commit would leave the connection in a broken non-committed non-rolled-back state.
- Fix a bug that result in leaking sockets/file descriptors on failed connection attempts for postgresql
- Fix an incompatibility with newer
libmysqlclientversions - Remove some potential harmful usages of
mem::uninitialized
-
1.4.423 Mar 2020Release notes
Open source →Fixed
- Update several dependencies
- Fixed a bug with printing embedded migrations
-
1.4.311 Oct 2019Release notes
Open source →Fixed
- Updated several dependencies
- Fixed an issue where the postgresql backend exploits implementation defined behaviour
- Fixed issue where rustdoc failed to build the documentation
diesel_derivesanddiesel_migrationsare updated to syn 1.0
-
1.4.219 Mar 2019Release notes
Open source →Fixed
- Parenthesis are now inserted around all mathematical operations. This means
that
(2.into_sql() + 3) * 4will correctly evaluate to 20 as expected. Previously we would generate SQL that evaluated to 14. This could even result in runtime errors if multiple types were involved (for example,interval * (integer + 1))
- Parenthesis are now inserted around all mathematical operations. This means
that
-
1.4.124 Jan 2019Release notes
Open source →Fixed
- This release fixes a minor memory safety issue in SQLite. This bug would only occur in an error handling branch that should never occur in practice.
-
1.4.021 Jan 2019Release notes
Open source →Fixed
embed_migrations!will no longer emit an unused import warning- Diesel now supports uuid 0.7 by adding the new feature flag
uuidv07
Added
-
Diesel CLI can be configured to error if a command would result in changes to your schema file by passing
--locked-schema. This is intended for use in CI and production deploys, to ensure that the committed schema file is up to date. -
A helper trait has been added for implementing
ToSqlfor PG composite types. SeeWriteTuplefor details.
-
Added support for MySQL's
UNSIGNED TINYINT -
DatabaseErrorKind::SerializationFailurehas been added, corresponding to SQLSTATE code 40001 (ASERIALIZABLEisolation level transaction failed to commit due to a read/write dependency on another transaction). This error is currently only detected on PostgreSQL. -
Diesel CLI can now generate completions for zsh and fish. See
diesel completions --helpfor details. -
#[belongs_to]can now accept types that are generic over lifetimes (for example, if one of the fields has the typeCow<'a, str>). To define an association to such a type, write#[belongs_to(parent = "User<'_>")] -
Nullable<Text>now supportsilikeexpression on in PostgreSQL. -
diesel_manage_updated_at('table_name')is now available on SQLite. This function can be called in your migrations to create a trigger which automatically sets theupdated_atcolumn, unless that column was updated in the query.
Changed
-
Diesel's derives now require that
extern crate diesel;be at your crate root (e.g.src/lib.rsorsrc/main.rs) -
Tinyinthas been renamed toTinyIntand an alias has been created fromTinyinttoTinyInt. -
The minimal officially supported rustc version is now 1.31.0
-
1.3.312 Sep 2018Release notes
Open source →Fixed
- Fixed an issue that occurred with MySQL 8.0 when calling
.executeor.batch_executewith a single query that returned a result set (such as ourSELECT 1health check inr2d2).
- Fixed an issue that occurred with MySQL 8.0 when calling
-
1.3.214 Jun 2018Release notes
Open source →Fixed
-
The behavior of unsigned types in MySQL has been corrected to properly set the
is_unsignedflag. -
Fixed an issue with
sql_function!when#[sql_name]was used on functions with no return type.
-
-
1.3.022 May 2018Release notes
Open source →Added
-
Diesel CLI now supports a configuration file. See diesel.rs/guides/configuring-diesel-cli for details.
-
sql_function!now supports generic functions. See the documentation forsql_function!for more details. -
sql_function!now supports aggregate functions likesumandmax, by annotating them with#[aggregate]. This skips the implementation ofNonAggregatefor your function. See the documentation forsql_function!for more details. -
sql_function!now supports renaming the function by annotating it with#[sql_name = "SOME_FUNCTION"]. This can be used to support functions with multiple signatures such as coalesce, by defining multiple rust functions (with different names) that have the same#[sql_name]. -
Added
sqlite-bundledfeature todiesel_clito make installing on some platforms easier. -
Custom SQL functions can now be used with SQLite. See the docs for details.
-
All functions and operators provided by Diesel can now be used with numeric operators if the SQL type supports it.
-
PgIntervalcan now be used with-,*, and/. -
Vec<T>is nowInsertable. It is no longer required to always place an&in front of.values. -
Added support for PG tuples. See
sql_types::Recordfor details.
- Added support for a wider range of locking clauses, including
FOR SHARE,SKIP LOCKED,NO WAIT, and more. SeeQueryDslfor details.
Changed
sql_function!has been redesigned. The syntax is nowsql_function!(fn lower(x: Text) -> Text);. The output of the new syntax is slightly different than what was generated in the past. See the documentation forsql_function!for more details.
- Diesel's minimum supported Rust version is 1.24.0. This was already true, but it is now tested and enforced. Any future changes to our minimum supported version will be listed in this change log.
Fixed
diesel print-schemaandinfer_schema!now properly handle unsigned types in MySQL
Deprecated
-
diesel_infer_schemahas been deprecated.diesel print-schemais now the only way to generate database schema. Diesel CLI can be configured to automatically regenerate your schema file when migrations are run. See diesel.rs/guides/configuring-diesel-cli for details. -
Uses of
sql_function!in the formsql_function!(foo, foo_t, (x: Integer))have been deprecated in favor of a new design (listed above). Note: Due to a bug in Rust, you may not see a deprecation warning from usage of the old form. As always, if you're concerned about relying on deprecated code, we recommend attempting to build your app withdefault-featuresturned off (specifically excluding thewith-deprecatedfeature). -
The
--whitelistand--blacklistoptions todiesel print-schemahave been deprecated and renamed--only-tablesand--exclude-tables.
-
-
1.2.212 Apr 2018Release notes
Open source →Changed
- Warnings are now allowed inside the crate. The way we had attempted to deprecate old feature names caused builds to break. We are still not happy with how this deprecation gets communicated, and will revisit it in the future.
-
1.2.111 Apr 2018Release notes
Open source →Changed
- Renamed
x32-column-tables,x64-column-tables, andx128-column-tablesto32-column-tables,64-column-tables, and128-column-tables. The leadingxwas due to a bug in crates.io discovered while publishing 1.2.0. The bug has since been fixed.
- Renamed
-
1.2.007 Apr 2018Release notes
Open source →Added
-
Added
SqlLiteral::bind(). This is intended to be used for binding values to small SQL fragments. Usesql_queryif 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 otherInsertablevalue. -
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
unstablefeature. For the best errors, you should also setRUSTFLAGS="--cfg procmacro2_semver_exempt". -
Added support for specifying
ISOLATION LEVEL,DEFERRABLE, andREAD ONLYon PG transactions. SeePgConnection::build_transactionfor details.
- Added support for
BEGIN IMMEDIATEandBEGIN EXCLUSIVEon SQLite. SeeSqliteConnection::immediate_transactionandSqliteConnection::exclusive_transactionfor details
-
Tables with more than 56 columns are now supported by enabling the
128-column-tablesfeature. -
Delete statements can now be boxed. This is useful for conditionally modifying the where clause of a delete statement. See
DeleteStatement::into_boxedfor details.
- Update statements can now be boxed. This is useful for conditionally modifying
the where clause of a update statement. See
UpdateStatement::into_boxedfor details.
-
Added
order_byas an alias fororder. -
Added
then_order_by, which appends to anORDER BYclause 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 nowInsertablealso on the struct itself, not only on references to the struct
-
ConnectionErrornow implementsPartialEq. -
Columns generated by
table!now implementDefault -
#[derive(AsChangeset)]now implementsAsChangeseton the struct itself, and not only on a reference to the struct -
Added support for deserializing
NumericintoBigDecimalon 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. -
32-column-tablesare now enabled by default.
Deprecated
-
ne_anyhas been renamed tone_all. -
The
large-tablesfeature has been has been renamed to32-column-tables. -
The
huge-tablesfeature has been renamed to64-column-tables. -
IncompleteUpdateStatementhas been removed. UseUpdateStatementinstead.
Fixed
-
diesel database setupnow correctly handles database URLs containing query strings -
diesel migration listshows 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.
-
existscan no longer incorrectly receive values other than select statements. -
MysqlConnection::establishcan now properly handle IPv6 addresses wrapped in square brackets.
Jokes
- Diesel is now powered by the blockchain because it's 2018.
-
-
1.1.205 Apr 2018 -
1.1.116 Jan 2018Release notes
Open source →Added
- Added
diesel::r2d2::PoolErroras an alias forr2d2::Error. Previously this type was inaccessible due todiesel::r2d2::Error.
- Added
-
1.1.015 Jan 2018Release notes
Open source →Added
-
r2d2-dieselhas been merged into Diesel proper. You should no longer rely directly onr2d2-dieselorr2d2. The functionality of both is exposed fromdiesel::r2d2. -
r2d2::PooledConnectionnow implementsConnection. This means that you should no longer need to write&*connectionwhen usingr2d2. -
The
BINARYcolumn type name is now supported for SQLite. -
The
QueryIdtrait can now be derived. -
FromSqlRowcan now be derived for types which implementFromSql. -
AsExpressioncan now be derived for types which implementToSql. -
HasSqlType,NotNull, andSingleValuecan now be derived with#[derive(SqlType)]. See the docs for those traits for more information. -
The return type of
FromSql,FromSqlRow, andQueryableByNamecan now be written asdeserialize::Result<Self>. -
The return type of
ToSqlcan now be written asserialize::Result. -
Added support for SQLite's
INSERT OR IGNOREand MySQL'sINSERT IGNOREvia theinsert_or_ignorefunction. -
minandmaxcan now be used with array expressions. -
Added
diesel::dsl::array, which corresponds to a PGARRAY[]literal. -
Added the
not_none!macro, used by implementations ofFromSqlwhich do not expectNULL. -
Added
result::UnexpectedNullError, anErrortype indicating that an unexpectedNULLwas received during deserialization. -
Added
.or_filter, which behaves identically to.filter, but usingORinstead ofAND. -
helper_typesnow contains a type for every method defined inexpression_methods, and every function indsl. -
Added
FromSqlimpls for*const strand*const [u8]everywhere thatStringandVecare supported. These impls do not allocate, and are intended for use by other impls which need to parse a string or bytes, and don't want to allocate. These impls should never be used outside of anotherFromSqlimpl.
Deprecated
- IMPORTANT NOTE Due to several
bugs in Rust, many of the deprecations in this
release may not show a warning. If you want to ensure you are not using any
deprecated items, we recommend attempting to compile your code without the
with-deprecatedfeature by addingdefault-features = falsetoCargo.toml.
-
Deprecated
impl_query_id!in favor of#[derive(QueryId)] -
Deprecated specifying a column name as
#[column_name(foo)].#[column_name = "foo"]should be used instead. -
The
typesmodule has been deprecated. It has been split intosql_types,serialize, anddeserialize. -
query_source::Queryableandquery_source::QueryableByNamehave been deprecated. These traits have been moved todeserialize. -
backend::TypeMetadatahas been deprecated. It has been moved tosql_types. -
types::ToSqlOutputhas been deprecated. It has been renamed toserialize::Output. -
helper_types::Notis nowhelper_types::not
Fixed
infer_schema!generates valid code when run against a database with no tables.
-
-
1.0.123 Jan 2018Nothing published for this version
-
1.0.002 Jan 2018Release notes
Open source →Added
-
#[derive(QueryableByName)]can now handle structs that have no associated table. If the#[table_name]annotation is left off, you must annotate each field with#[sql_type = "Integer"] -
#[derive(QueryableByName)]can now handle embedding other structs. To have a field whose type is a struct which implementsQueryableByName, rather than a single column in the query, add the annotation#[diesel(embed)] -
The
QueryDsltrait encompasses the majority of the traits that were previously in thequery_dslmodule.
Fixed
-
Executing select statements on SQLite will no longer panic when the database returns
SQLITE_BUSY -
table!s which use theDatetimetype with MySQL will now compile correctly, even without thechronofeature enabled. -
#[derive(QueryableByName)]will now compile correctly when there is a shadowedResulttype in scope. -
BoxableExpressioncan now be used with types that are not'static
Changed
-
Connection::test_transactionnow requires that the error returned implementDebug. -
query_builder::insert_statement::InsertStatementis now accessed asquery_builder::InsertStatement -
query_builder::insert_statement::UndecoratedInsertRecordis now accessed asquery_builder::UndecoratedInsertRecord -
#[derive(QueryableByName)]now requires that the table name be explicitly stated. -
Most of the traits in
query_dslhave been moved toquery_dsl::methods. These traits are no longer exported inprelude. This should not affect most apps, as the behavior of these traits is provided byQueryDsl. However, if you were using these traits inwhereclauses for generic code, you will need to explicitly douse diesel::query_dsl::methods::WhateverDsl. You may also need to use UFCS in these cases. -
If you have a type which implemented
QueryFragmentorQuery, which you intended to be able to callexecuteorloadon, you will need to manually implementRunQueryDslfor that type. The trait should be unconditionally implemented (no where clause beyond what your type requires), and the body should be empty.
Removed
-
All deprecated items have been removed.
-
LoadDslandFirstDslhave been removed. Their functionality now lives inLoadQuery.
-