From b59b0ddf2e3906716abe3756f09217d57d3589ee Mon Sep 17 00:00:00 2001 From: gwenn Date: Sun, 16 Apr 2023 16:17:36 +0200 Subject: [PATCH] Bump sqlite3-parser version --- libsqlite3-sys/build.rs | 1 + rusqlite-macros/Cargo.toml | 2 +- rusqlite-macros/src/lib.rs | 1 - rusqlite-macros/tests/test.rs | 6 +++--- src/lib.rs | 7 ++++--- 5 files changed, 9 insertions(+), 8 deletions(-) diff --git a/libsqlite3-sys/build.rs b/libsqlite3-sys/build.rs index e3c065a..da785e4 100644 --- a/libsqlite3-sys/build.rs +++ b/libsqlite3-sys/build.rs @@ -497,6 +497,7 @@ mod bindings { None } } + fn item_name(&self, original_item_name: &str) -> Option { original_item_name .strip_prefix("sqlite3_index_info_") diff --git a/rusqlite-macros/Cargo.toml b/rusqlite-macros/Cargo.toml index 7dae87a..5c5db10 100644 --- a/rusqlite-macros/Cargo.toml +++ b/rusqlite-macros/Cargo.toml @@ -12,5 +12,5 @@ categories = ["database"] proc-macro = true [dependencies] -sqlite3-parser = { version = "0.5.0", default-features = false, features = ["YYNOERRORRECOVERY"] } +sqlite3-parser = { version = "0.7.0", default-features = false, features = ["YYNOERRORRECOVERY"] } fallible-iterator = "0.2" diff --git a/rusqlite-macros/src/lib.rs b/rusqlite-macros/src/lib.rs index cf41258..2369639 100644 --- a/rusqlite-macros/src/lib.rs +++ b/rusqlite-macros/src/lib.rs @@ -21,7 +21,6 @@ fn try_bind(input: TokenStream) -> Result { let (stmt, literal) = { let mut iter = input.clone().into_iter(); let stmt = iter.next().unwrap(); - let _punct = iter.next().unwrap(); let literal = iter.next().unwrap(); assert!(iter.next().is_none()); (stmt, literal) diff --git a/rusqlite-macros/tests/test.rs b/rusqlite-macros/tests/test.rs index 7a97ae4..785ca9b 100644 --- a/rusqlite-macros/tests/test.rs +++ b/rusqlite-macros/tests/test.rs @@ -16,7 +16,7 @@ fn test_literal() -> Result { let first_name = "El"; let last_name = "Barto"; let mut stmt = Stmt; - __bind!(stmt, "SELECT $first_name, $last_name"); + __bind!(stmt "SELECT $first_name, $last_name"); Ok(()) } @@ -24,13 +24,13 @@ fn test_literal() -> Result { #[test] fn test_raw_string() { let stmt = (); - __bind!((), r#"SELECT 1"#); + __bind!(stmt r#"SELECT 1"#); } #[test] fn test_const() { const SQL: &str = "SELECT 1"; let stmt = (); - __bind!((), SQL); + __bind!(stmt SQL); } */ diff --git a/src/lib.rs b/src/lib.rs index 7f95735..1b3b17e 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -221,7 +221,7 @@ macro_rules! prepare_and_bind { #[cfg(trick_rust_analyzer_into_highlighting_interpolated_bits)] format_args!($sql); let mut stmt = $conn.prepare($sql)?; - $crate::__bind!(stmt, $sql); + $crate::__bind!(stmt $sql); stmt }}; } @@ -233,7 +233,7 @@ macro_rules! prepare_cached_and_bind { #[cfg(trick_rust_analyzer_into_highlighting_interpolated_bits)] format_args!($sql); let mut stmt = $conn.prepare_cached($sql)?; - $crate::__bind!(stmt, $sql); + $crate::__bind!(stmt $sql); stmt }}; } @@ -923,7 +923,8 @@ impl Connection { /// /// This function is unsafe because improper use may impact the Connection. /// In particular, it should only be called on connections created - /// and owned by the caller, e.g. as a result of calling ffi::sqlite3_open(). + /// and owned by the caller, e.g. as a result of calling + /// ffi::sqlite3_open(). #[inline] pub unsafe fn from_handle_owned(db: *mut ffi::sqlite3) -> Result { let db = InnerConnection::new(db, true);