Skip to content

Commit

Permalink
Merge pull request #3851 from weiznich/bump/sqlite_0.27
Browse files Browse the repository at this point in the history
Bump libsqlite to allow 0.27
  • Loading branch information
weiznich authored Nov 13, 2023
2 parents b51567f + 204513d commit 99857a2
Show file tree
Hide file tree
Showing 15 changed files with 18 additions and 10 deletions.
2 changes: 1 addition & 1 deletion diesel/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ rust-version = "1.66.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
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;
2 changes: 2 additions & 0 deletions diesel/src/query_source/aliasing/alias.rs
Original file line number Diff line number Diff line change
Expand Up @@ -207,9 +207,11 @@ where
/// To be able to define `helper_types::Fields` with the usual conventions
///
/// This type is intentionally not publicly exported
#[allow(unreachable_pub)]
pub trait GetAliasSourceFromAlias {
type Source;
}

impl<S> GetAliasSourceFromAlias for Alias<S> {
type Source = S;
}
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
2 changes: 2 additions & 0 deletions diesel/src/sqlite/connection/raw.rs
Original file line number Diff line number Diff line change
Expand Up @@ -200,6 +200,8 @@ impl RawConnection {
}

pub(super) fn deserialize(&mut self, data: &[u8]) -> QueryResult<()> {
// the cast for `ffi::SQLITE_DESERIALIZE_READONLY` is required for old libsqlite3-sys versions
#[allow(clippy::unnecessary_cast)]
unsafe {
let result = ffi::sqlite3_deserialize(
self.internal_connection.as_ptr(),
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 @@ -31,7 +31,7 @@ heck = "0.4.0"
serde = { version = "1.0.0", features = ["derive"] }
toml = "0.8"
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
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
2 changes: 1 addition & 1 deletion examples/sqlite/all_about_inserts/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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.17.2, <0.27.0", features = ["bundled"] }
libsqlite3-sys = { version = "0.27.0", features = ["bundled"] }

[lib]
doc = false
2 changes: 1 addition & 1 deletion examples/sqlite/getting_started_step_1/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ publish = false
[dependencies]
diesel = { version = "2.1.0", path = "../../../diesel", features = ["sqlite"] }
dotenvy = "0.15"
libsqlite3-sys = { version = ">=0.17.2, <0.27.0", features = ["bundled"] }
libsqlite3-sys = { version = "0.27.0", features = ["bundled"] }

[[bin]]
name = "show_posts"
Expand Down
2 changes: 1 addition & 1 deletion examples/sqlite/getting_started_step_2/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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.17.2, <0.27.0", features = ["bundled"] }
libsqlite3-sys = { version = "0.27.0", features = ["bundled"] }

[[bin]]
name = "show_posts"
Expand Down
2 changes: 1 addition & 1 deletion examples/sqlite/getting_started_step_3/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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.17.2, <0.27.0", features = ["bundled"] }
libsqlite3-sys = { version = "0.27.0", features = ["bundled"] }

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

0 comments on commit 99857a2

Please sign in to comment.