diff --git a/CHANGELOG.md b/CHANGELOG.md index 5a6fe4c1448a..b02ba13accd0 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -17,6 +17,7 @@ Increasing the minimal supported Rust version will always be coupled at least wi * Fix an inconsistent unit test * Fix a clippy lint * Fix ./bin/test feature flag calls. +* Update `libsqlite3-sys` to allow version 0.28 as well ## [2.1.4] 2023-11-14 @@ -59,6 +60,8 @@ Increasing the minimal supported Rust version will always be coupled at least wi ### Added +* Added `serialize_database_to_buffer` and `deserialize_readonly_database_from_buffer` methods in `SqliteConnection` to support serialization/deserialization of SQLite databases to and from byte buffers. +* Added `SerializedDatabase` wrapper type for a serialized database that is dynamically allocated by calling `serialize_database_to_buffer`. This RAII wrapper deallocates the memory when it goes out of scope with `sqlite3_free`. * Added the `custom_type_derives` config option to customize the derives for SQL type definitions automatically generated by Diesel CLI. * Add a `#[derive(MultiConnection)]` proc-macro that lets you easily implement `diesel::Connection` @@ -73,7 +76,7 @@ Increasing the minimal supported Rust version will always be coupled at least wi ## [2.0.4] 2023-04-18 -## Fixed +## Fixed * Workaround the missing name resolution in rust-analyzer. This should fix type inference for some diesel queries. (It remains broken for queries containing `.filter()`/`.inner_join()`/`.left_join()`. These require fixes in rust-analyzer itself) * Fixed a bug that could lead to inserting null values instead of empty values for custom sqlite types @@ -84,9 +87,9 @@ Increasing the minimal supported Rust version will always be coupled at least wi * Support for `libsqlite3-sys` 0.26 -## [diesel_derives 2.0.2] 2023-03-13 +## [diesel_derives 2.0.2] 2023-03-13 -## Fixed +## Fixed * Fixing the fallout of a breaking change from `quote` by not using their internal API @@ -155,7 +158,7 @@ Increasing the minimal supported Rust version will always be coupled at least wi in such a way to support constructing a dynamic value depending on this type. * Added a `without-deprecated` feature that unconditionally disables deprecated items. - Use this feature flag to verify that none of your dependencies is setting + Use this feature flag to verify that none of your dependencies is setting the `with-deprecated` flag internally. * Added support for PostgreSQL's `SIMILAR TO` and `NOT SIMILAR TO`. @@ -179,7 +182,7 @@ Increasing the minimal supported Rust version will always be coupled at least wi * 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_definitions` config option. -* Added an option to `#[derive(Insertable)]` that let you insert `NULL` values instead of `DEFAULT` values for `Option` +* Added an option to `#[derive(Insertable)]` that let you insert `NULL` values instead of `DEFAULT` values for `Option` * Added support for all the derive attributes being inside `#[diesel(...)]` @@ -284,12 +287,12 @@ Increasing the minimal supported Rust version will always be coupled at least wi card implementations for types implementing `Queryable` or `QueryableByName` so non generic code does not require any change. For generic code you likely need to replace a trait bound on `Queryable` with a trait bound on `FromSqlRow` - and a bound to `QueryableByName` with `FromSqlRow`. + and a bound to `QueryableByName` with `FromSqlRow`. * CLI flags of `only-tables` and `except-tables` are now interpreted as regular expressions. - Similarly, `only_tabels` and `except_tables` in `diesel.toml` are treated as regular expressions. + Similarly, `only_tables` and `except_tables` in `diesel.toml` are treated as regular expressions. -* Now you can sort column fields by name with the `column-sorting` option. +* Now you can sort column fields by name with the `column-sorting` option. It can be set to either `ordinal_position` (default) or `name`. This ensures stable sorting even if columns are removed and re-added. @@ -302,25 +305,25 @@ Increasing the minimal supported Rust version will always be coupled at least wi * `TypeMetadata::MetadataLookup` is now `?Sized`. -* Multiple implementations of `Connection` are now possible +* Multiple implementations of `Connection` are now possible because of the new `PgMetadataLookup` trait. * For the `Pg` backend, `TypeMetadata::MetadataLookup` has changed to `dyn PgMetadataLookup`. -* Diesel's migration framework was rewritten from the ground. Existing migrations continue to +* Diesel's migration framework was rewritten from the ground. Existing migrations continue to be compatible with the rewrite, but code calling into `diesel_migrations` requires an update. See the [migration guide](2-0-migration) for details. * `eq_any()` now emits a `= ANY()` expression for the postgresql backend instead of `IN()` * `ne_all()` now emits a `!= ALL()` expression for the postgresql backend instead of `NOT IN()` -* The sqlite backend now uses a single batch insert statement if there are now default values present +* 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_sql` and `QueryFragment::walk_ast` has changed to allow serializing values without +* The definition of `ToSql::to_sql` and `QueryFragment::walk_ast` has 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 + with the database. Beside of the changed signature, existing impls of this trait should remain unchanged in almost all cases. * The `PIPES_AS_CONCAT` sql_mode is no longer set @@ -367,14 +370,14 @@ queries or set `PIPES_AS_CONCAT` manually. * 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 `ExpressionMethods` traits * Queries containing a `distinct on` clause check now on compile time that a compatible order clause was set. * Implementations of custom SQLite SQL functions now check for panics -* `diesel print-schema` now generates `Array>` rather than `Array` for Postgres Array types. Existence of +* `diesel print-schema` now generates `Array>` rather than `Array` for Postgres Array types. Existence of `NULL` values in database arrays would previously result in deserialization errors. Non-nullable arrays are now opt in (by schema patching). @@ -388,10 +391,11 @@ queries or set `PIPES_AS_CONCAT` manually. * `diesel::pg::upsert` has been deprecated to support upsert queries on more than one backend. Please use `diesel::upsert` instead. - -* `diesel::dsl::any` and `diesel::dsl::all` are now deprecated in + +* `diesel::dsl::any` and `diesel::dsl::all` are now deprecated in favour of `ExpressionMethods::eq_any()` and `ExpressionMethods::ne_all()` + [2-0-migration]: https://github.com/diesel-rs/diesel/blob/master/guide_drafts/migration_guide.md ## [1.4.8] - 2021-09-20 @@ -443,6 +447,7 @@ queries or set `PIPES_AS_CONCAT` manually. * Fixed issue where rustdoc failed to build the documentation * `diesel_derives` and `diesel_migrations` are updated to syn 1.0 + ## [1.4.2] - 2019-03-19 ### Fixed @@ -1569,7 +1574,7 @@ queries or set `PIPES_AS_CONCAT` manually. * Added partial support for composite primary keys. * Added support for PostgreSQL `NULLS FIRST` and `NULLS LAST` when sorting. - See + See https://docs.diesel.rs/diesel/prelude/trait.SortExpressionMethods.html for details. * Added support for the `timestamp with time zone` type in PostgreSQL (referred @@ -1639,22 +1644,22 @@ queries or set `PIPES_AS_CONCAT` manually. * The `Insertable!` macro can now be used instead of `#[insertable_into]` for those wishing to avoid syntax extensions from `diesel_codegen`. See - for details. + https://docs.diesel.rs/diesel/macro.Insertable!.html for details. * The `Queryable!` macro can now be used instead of `#[derive(Queryable)]` for those wishing to avoid syntax extensions from `diesel_codegen`. See - for details. + https://docs.diesel.rs/diesel/macro.Queryable!.html for details. * The `Identifiable!` macro can now be used instead of `#[derive(Identifiable)]` for those wishing to avoid syntax extensions from `diesel_codegen`. See - for details. + https://docs.diesel.rs/diesel/macro.Identifiable!.html for details. * The `AsChangeset!` macro can now be used instead of `#[changeset_for(table)]` for those wishing to avoid syntax extensions from `diesel_codegen`. See - for details. + https://docs.diesel.rs/diesel/macro.AsChangeset!.html for details. * Added support for the PostgreSQL `ALL` operator. See - for details. + https://docs.diesel.rs/diesel/pg/expression/dsl/fn.all.html for details. * Added support for `RETURNING` expressions in `DELETE` statements. Implicitly these queries will use `RETURNING *`. @@ -1681,8 +1686,8 @@ queries or set `PIPES_AS_CONCAT` manually. `#[column_name(name)]`. * The structure of `DatabaseError` has changed to hold more information. See - and - for + https://docs.diesel.rs/diesel/result/enum.Error.html and + https://docs.diesel.rs/diesel/result/trait.DatabaseErrorInformation.html for more information * Structs which implement `Identifiable` can now be passed to `update` and @@ -2057,14 +2062,10 @@ queries or set `PIPES_AS_CONCAT` manually. [1.4.8]: https://github.com/diesel-rs/diesel/compare/v1.4.7...v1.4.8 [2.0.0 Rc0]: https://github.com/diesel-rs/diesel/compare/v.1.4.0...v2.0.0-rc0 [2.0.0 Rc1]: https://github.com/diesel-rs/diesel/compare/v.2.0.0-rc0...v2.0.0-rc1 -[2.0.0]: https://github.com/diesel-rs/diesel/compare/v1.4.0...v2.0.0 -[2.0.1]: https://github.com/diesel-rs/diesel/compare/v2.0.0...v2.0.1 -[2.0.2]: https://github.com/diesel-rs/diesel/compare/v2.0.1...v2.0.2 +[2.0.0]: https://github.com/diesel-rs/diesel/compare/v.1.4.0...v2.0.0 +[2.0.1]: https://github.com/diesel-rs/diesel/compare/v.2.0.0...v2.0.1 +[2.0.2]: https://github.com/diesel-rs/diesel/compare/v.2.0.1...v2.0.2 [diesel_derives 2.0.2]: https://github.com/diesel-rs/diesel/compare/v.2.0.2...diesel_derives_v2.0.2 -[2.0.3]: https://github.com/diesel-rs/diesel/compare/v2.0.2...v2.0.3 -[2.0.4]: https://github.com/diesel-rs/diesel/compare/v2.0.3...v2.0.4 -[2.1.0]: https://github.com/diesel-rs/diesel/compare/v2.0.0...v2.1.0 -[2.1.1]: https://github.com/diesel-rs/diesel/compare/v2.1.0...v2.1.1 -[2.1.2]: https://github.com/diesel-rs/diesel/compare/v2.1.1...v2.1.2 -[2.1.3]: https://github.com/diesel-rs/diesel/compare/v2.1.2...v2.1.3 -[2.1.4]: https://github.com/diesel-rs/diesel/compare/v2.1.3...v2.1.4 +[2.0.3]: https://github.com/diesel-rs/diesel/compare/v.2.0.2...v2.0.3 +[2.0.4]: https://github.com/diesel-rs/diesel/compare/v.2.0.3...v2.0.4 +[2.1.0]: https://github.com/diesel-rs/diesel/compare/v.2.0.0...v2.1.0 diff --git a/diesel/Cargo.toml b/diesel/Cargo.toml index ccbf86401959..0eb4b6d9763a 100644 --- a/diesel/Cargo.toml +++ b/diesel/Cargo.toml @@ -16,7 +16,7 @@ rust-version = "1.65.0" byteorder = { version = "1.0", optional = true } chrono = { version = "0.4.20", optional = true, default-features = false, features = ["clock", "std"] } libc = { version = "0.2.0", optional = true } -libsqlite3-sys = { version = ">=0.17.2, <0.28.0", optional = true, features = ["bundled_bindings"] } +libsqlite3-sys = { version = ">=0.17.2, <0.29.0", optional = true, features = ["bundled_bindings"] } mysqlclient-sys = { version = "0.2.5", optional = true } pq-sys = { version = "0.4.0", optional = true } quickcheck = { version = "1.0.3", optional = true } diff --git a/diesel_cli/Cargo.toml b/diesel_cli/Cargo.toml index c877248bfe9b..01a1970f3ecb 100644 --- a/diesel_cli/Cargo.toml +++ b/diesel_cli/Cargo.toml @@ -27,7 +27,7 @@ heck = "0.4.0" serde = { version = "1.0.0", features = ["derive"] } toml = "0.7" url = { version = "2.2.2" } -libsqlite3-sys = { version = ">=0.17.2, <0.28.0", optional = true } +libsqlite3-sys = { version = ">=0.17.2, <0.29.0", optional = true } diffy = "0.3.0" regex = "1.0.6" serde_regex = "1.1" diff --git a/diesel_tests/Cargo.toml b/diesel_tests/Cargo.toml index 5fdd4a5f35dd..1d4d23297247 100644 --- a/diesel_tests/Cargo.toml +++ b/diesel_tests/Cargo.toml @@ -21,7 +21,7 @@ ipnet = { version = "2.5.0" } ipnetwork = ">=0.12.2, <0.21.0" bigdecimal = ">= 0.0.13, < 0.5.0" rand = "0.8.4" -libsqlite3-sys = { version = "0.27", optional = true } +libsqlite3-sys = { version = "0.28", optional = true } [features] default = [] diff --git a/examples/sqlite/all_about_inserts/Cargo.toml b/examples/sqlite/all_about_inserts/Cargo.toml index 80f6e615d21a..00ff023eb31d 100644 --- a/examples/sqlite/all_about_inserts/Cargo.toml +++ b/examples/sqlite/all_about_inserts/Cargo.toml @@ -9,7 +9,7 @@ diesel = { version = "2.1.0", path = "../../../diesel", features = ["sqlite", "c serde = { version = "1.0.130", features = ["derive"] } serde_json = "1.0.68" chrono = { version = "0.4.20", default-features = false, features = ["clock", "std"] } -libsqlite3-sys = { version = "0.27.0", features = ["bundled"] } +libsqlite3-sys = { version = "0.28.0", features = ["bundled"] } [lib] doc = false diff --git a/examples/sqlite/getting_started_step_1/Cargo.toml b/examples/sqlite/getting_started_step_1/Cargo.toml index a53a790cfa1c..a72fddd5c3b2 100644 --- a/examples/sqlite/getting_started_step_1/Cargo.toml +++ b/examples/sqlite/getting_started_step_1/Cargo.toml @@ -9,7 +9,7 @@ publish = false [dependencies] diesel = { version = "2.1.0", path = "../../../diesel", features = ["sqlite"] } dotenvy = "0.15" -libsqlite3-sys = { version = "0.27.0", features = ["bundled"] } +libsqlite3-sys = { version = "0.28.0", features = ["bundled"] } [[bin]] name = "show_posts" diff --git a/examples/sqlite/getting_started_step_2/Cargo.toml b/examples/sqlite/getting_started_step_2/Cargo.toml index ad212b010c17..9d645210109a 100644 --- a/examples/sqlite/getting_started_step_2/Cargo.toml +++ b/examples/sqlite/getting_started_step_2/Cargo.toml @@ -8,7 +8,7 @@ publish = false [dependencies] diesel = { version = "2.1.0", path = "../../../diesel", features = ["sqlite", "returning_clauses_for_sqlite_3_35"] } dotenvy = "0.15" -libsqlite3-sys = { version = "0.27.0", features = ["bundled"] } +libsqlite3-sys = { version = "0.28.0", features = ["bundled"] } [[bin]] name = "show_posts" diff --git a/examples/sqlite/getting_started_step_3/Cargo.toml b/examples/sqlite/getting_started_step_3/Cargo.toml index 44be61c4b8a1..140058f212e4 100644 --- a/examples/sqlite/getting_started_step_3/Cargo.toml +++ b/examples/sqlite/getting_started_step_3/Cargo.toml @@ -8,7 +8,7 @@ publish = false [dependencies] diesel = { version = "2.1.0", path = "../../../diesel", features = ["sqlite", "returning_clauses_for_sqlite_3_35"] } dotenvy = "0.15" -libsqlite3-sys = { version = "0.27.0", features = ["bundled"] } +libsqlite3-sys = { version = "0.28.0", features = ["bundled"] } [[bin]] name = "show_posts"