Skip to content

Commit

Permalink
Prepare a 2.1.4 release
Browse files Browse the repository at this point in the history
  • Loading branch information
weiznich committed Nov 14, 2023
1 parent a4b5a8b commit ba2f567
Show file tree
Hide file tree
Showing 18 changed files with 43 additions and 34 deletions.
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,10 @@ Increasing the minimal supported Rust version will always be coupled at least wi

## Unreleased

## [2.1.4] 2023-11-14

* Update `libsqlite3-sys` to allow version 0.27 as well

## [2.1.3] 2023-10-05

* Increased accidently decreased limit around element count in `DISTINCT ON` and `ORDER BY` clauses again as that broke existing code
Expand Down Expand Up @@ -2058,3 +2062,4 @@ queries or set `PIPES_AS_CONCAT` manually.
[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
4 changes: 2 additions & 2 deletions diesel/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "diesel"
version = "2.1.3"
version = "2.1.4"
license = "MIT OR Apache-2.0"
description = "A safe, extensible ORM and Query Builder for PostgreSQL, SQLite, and MySQL"
readme = "README.md"
Expand All @@ -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.27.0", optional = true, features = ["bundled_bindings"] }
libsqlite3-sys = { version = ">=0.17.2, <0.28.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 }
Expand Down
1 change: 1 addition & 0 deletions diesel/src/connection/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -547,6 +547,7 @@ pub(crate) mod private {

// These impls are only there for backward compatibility reasons
// Remove them on the next breaking release
#[allow(unreachable_pub)] // must be pub for the type def using this trait
#[cfg(all(feature = "with-deprecated", not(feature = "without-deprecated")))]
pub trait ConnectionHelperType<DB, B>: super::LoadConnection<B, Backend = DB> {
type Cursor<'conn, 'query>
Expand Down
2 changes: 1 addition & 1 deletion diesel/src/macros/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ pub(crate) mod prelude {
allow(deprecated)
)]
// This is a false positive, we reexport it later
#[allow(unreachable_pub)]
#[allow(unreachable_pub, unused_imports)]
#[doc(inline)]
pub use crate::{
allow_columns_to_appear_in_same_group_by_clause, allow_tables_to_appear_in_same_query,
Expand Down
1 change: 0 additions & 1 deletion diesel/src/pg/types/date_and_time/std_time.rs
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,6 @@ const USEC_PER_SEC: u64 = 1_000_000;
const NANO_PER_USEC: u32 = 1_000;

fn usecs_to_duration(usecs_passed: u64) -> Duration {
let usecs_passed = usecs_passed;
let seconds = usecs_passed / USEC_PER_SEC;
let subsecond_usecs = usecs_passed % USEC_PER_SEC;
let subseconds = subsecond_usecs as u32 * NANO_PER_USEC;
Expand Down
2 changes: 1 addition & 1 deletion diesel/src/query_builder/distinct_clause.rs
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,6 @@ impl<O> ValidOrderingForDistinct<NoDistinctClause> for O {}
impl<O> ValidOrderingForDistinct<DistinctClause> for O {}

// This is rexported from another location
#[allow(unreachable_pub)]
#[allow(unreachable_pub, unused_imports)]
#[cfg(feature = "postgres_backend")]
pub use crate::pg::DistinctOnClause;
1 change: 1 addition & 0 deletions diesel/src/row.rs
Original file line number Diff line number Diff line change
Expand Up @@ -265,6 +265,7 @@ pub(crate) mod private {
// These impls are only there for backward compatibility reasons
// Remove them on the next breaking release
#[cfg(all(feature = "with-deprecated", not(feature = "without-deprecated")))]
#[allow(unreachable_pub)]
pub trait RowLifetimeHelper<DB>: for<'a> super::Row<'a, DB>
where
DB: Backend,
Expand Down
11 changes: 4 additions & 7 deletions diesel/src/sqlite/connection/statement_iterator.rs
Original file line number Diff line number Diff line change
Expand Up @@ -51,13 +51,10 @@ impl<'stmt, 'query> StatementIterator<'stmt, 'query> {
match res {
Err(e) => Some(Err(e)),
Ok(false) => None,
Ok(true) => {
let field_count = field_count;
Some(Ok(SqliteRow {
inner: Rc::clone(outer_last_row),
field_count,
}))
}
Ok(true) => Some(Ok(SqliteRow {
inner: Rc::clone(outer_last_row),
field_count,
})),
}
} else {
// any other state than `PrivateSqliteRow::Direct` is invalid here
Expand Down
2 changes: 2 additions & 0 deletions diesel/src/sqlite/connection/stmt.rs
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,8 @@ impl Statement {
) -> QueryResult<Self> {
let mut stmt = ptr::null_mut();
let mut unused_portion = ptr::null();
// the cast for `ffi::SQLITE_PREPARE_PERSISTENT` is required for old libsqlite3-sys versions
#[allow(clippy::unnecessary_cast)]
let prepare_result = unsafe {
ffi::sqlite3_prepare_v3(
raw_connection.internal_connection.as_ptr(),
Expand Down
2 changes: 1 addition & 1 deletion diesel_cli/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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.27.0", optional = true }
libsqlite3-sys = { version = ">=0.17.2, <0.28.0", optional = true }
diffy = "0.3.0"
regex = "1.0.6"
serde_regex = "1.1"
Expand Down
36 changes: 18 additions & 18 deletions diesel_cli/src/migrations/diff_schema.rs
Original file line number Diff line number Diff line change
Expand Up @@ -53,25 +53,25 @@ pub fn generate_sql_based_on_diff_schema(

let foreign_keys =
crate::infer_schema_internals::load_foreign_key_constraints(&mut conn, None)?;
let foreign_key_map = foreign_keys.into_iter().fold(HashMap::new(), |mut acc, t| {
acc.entry(t.child_table.rust_name.clone())
.or_insert_with(Vec::new)
.push(t);
acc
});

let mut expected_fk_map =
tables_from_schema
.joinable
let foreign_key_map =
foreign_keys
.into_iter()
.try_fold(HashMap::new(), |mut acc, t| {
t.map(|t| {
acc.entry(t.child_table.to_string())
.or_insert_with(Vec::new)
.push(t);
acc
})
})?;
.fold(HashMap::<_, Vec<_>>::new(), |mut acc, t| {
acc.entry(t.child_table.rust_name.clone())
.or_default()
.push(t);
acc
});

let mut expected_fk_map = tables_from_schema.joinable.into_iter().try_fold(
HashMap::<_, Vec<_>>::new(),
|mut acc, t| {
t.map(|t| {
acc.entry(t.child_table.to_string()).or_default().push(t);
acc
})
},
)?;

let table_pk_key_list = tables_from_schema
.table_decls
Expand Down
2 changes: 1 addition & 1 deletion diesel_derives/src/sql_function.rs
Original file line number Diff line number Diff line change
Expand Up @@ -221,7 +221,7 @@ pub(crate) fn expand(input: SqlFunctionDecl) -> TokenStream {
}
};
}
x if x == 1 => {
1 => {
let arg_name = arg_name[0];
let arg_type = arg_type[0];

Expand Down
2 changes: 1 addition & 1 deletion diesel_tests/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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.26", optional = true }
libsqlite3-sys = { version = "0.27", optional = true }

[features]
default = []
Expand Down
2 changes: 1 addition & 1 deletion diesel_tests/tests/types_roundtrip.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@ use diesel::query_dsl::LoadQuery;
pub use quickcheck::quickcheck;

pub use crate::schema::{connection_without_transaction, TestConnection};
#[cfg(not(feature = "sqlite"))]
pub use diesel::data_types::*;
pub use diesel::result::Error;
pub use diesel::serialize::ToSql;
pub use diesel::sql_types::{HasSqlType, SingleValue, SqlType};
pub use diesel::*;

Expand Down
1 change: 1 addition & 0 deletions examples/sqlite/all_about_inserts/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +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"] }

[lib]
doc = false
1 change: 1 addition & 0 deletions examples/sqlite/getting_started_step_1/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +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"] }

[[bin]]
name = "show_posts"
Expand Down
1 change: 1 addition & 0 deletions examples/sqlite/getting_started_step_2/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +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"] }

[[bin]]
name = "show_posts"
Expand Down
1 change: 1 addition & 0 deletions examples/sqlite/getting_started_step_3/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +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"] }

[[bin]]
name = "show_posts"
Expand Down

0 comments on commit ba2f567

Please sign in to comment.