Bump sqlite3-parser version

This commit is contained in:
gwenn 2023-04-16 16:17:36 +02:00
parent a927ce1bb6
commit b59b0ddf2e
5 changed files with 9 additions and 8 deletions

View File

@ -497,6 +497,7 @@ mod bindings {
None None
} }
} }
fn item_name(&self, original_item_name: &str) -> Option<String> { fn item_name(&self, original_item_name: &str) -> Option<String> {
original_item_name original_item_name
.strip_prefix("sqlite3_index_info_") .strip_prefix("sqlite3_index_info_")

View File

@ -12,5 +12,5 @@ categories = ["database"]
proc-macro = true proc-macro = true
[dependencies] [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" fallible-iterator = "0.2"

View File

@ -21,7 +21,6 @@ fn try_bind(input: TokenStream) -> Result<TokenStream> {
let (stmt, literal) = { let (stmt, literal) = {
let mut iter = input.clone().into_iter(); let mut iter = input.clone().into_iter();
let stmt = iter.next().unwrap(); let stmt = iter.next().unwrap();
let _punct = iter.next().unwrap();
let literal = iter.next().unwrap(); let literal = iter.next().unwrap();
assert!(iter.next().is_none()); assert!(iter.next().is_none());
(stmt, literal) (stmt, literal)

View File

@ -16,7 +16,7 @@ fn test_literal() -> Result {
let first_name = "El"; let first_name = "El";
let last_name = "Barto"; let last_name = "Barto";
let mut stmt = Stmt; let mut stmt = Stmt;
__bind!(stmt, "SELECT $first_name, $last_name"); __bind!(stmt "SELECT $first_name, $last_name");
Ok(()) Ok(())
} }
@ -24,13 +24,13 @@ fn test_literal() -> Result {
#[test] #[test]
fn test_raw_string() { fn test_raw_string() {
let stmt = (); let stmt = ();
__bind!((), r#"SELECT 1"#); __bind!(stmt r#"SELECT 1"#);
} }
#[test] #[test]
fn test_const() { fn test_const() {
const SQL: &str = "SELECT 1"; const SQL: &str = "SELECT 1";
let stmt = (); let stmt = ();
__bind!((), SQL); __bind!(stmt SQL);
} }
*/ */

View File

@ -221,7 +221,7 @@ macro_rules! prepare_and_bind {
#[cfg(trick_rust_analyzer_into_highlighting_interpolated_bits)] #[cfg(trick_rust_analyzer_into_highlighting_interpolated_bits)]
format_args!($sql); format_args!($sql);
let mut stmt = $conn.prepare($sql)?; let mut stmt = $conn.prepare($sql)?;
$crate::__bind!(stmt, $sql); $crate::__bind!(stmt $sql);
stmt stmt
}}; }};
} }
@ -233,7 +233,7 @@ macro_rules! prepare_cached_and_bind {
#[cfg(trick_rust_analyzer_into_highlighting_interpolated_bits)] #[cfg(trick_rust_analyzer_into_highlighting_interpolated_bits)]
format_args!($sql); format_args!($sql);
let mut stmt = $conn.prepare_cached($sql)?; let mut stmt = $conn.prepare_cached($sql)?;
$crate::__bind!(stmt, $sql); $crate::__bind!(stmt $sql);
stmt stmt
}}; }};
} }
@ -923,7 +923,8 @@ impl Connection {
/// ///
/// This function is unsafe because improper use may impact the Connection. /// This function is unsafe because improper use may impact the Connection.
/// In particular, it should only be called on connections created /// 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] #[inline]
pub unsafe fn from_handle_owned(db: *mut ffi::sqlite3) -> Result<Connection> { pub unsafe fn from_handle_owned(db: *mut ffi::sqlite3) -> Result<Connection> {
let db = InnerConnection::new(db, true); let db = InnerConnection::new(db, true);