diff --git a/rdbc-mysql/Cargo.toml b/rdbc-mysql/Cargo.toml index 9530210..0b0cc46 100644 --- a/rdbc-mysql/Cargo.toml +++ b/rdbc-mysql/Cargo.toml @@ -13,4 +13,4 @@ rdbc = { path = "../rdbc", version = "0.1.6" } mysql = "17.0.0" mysql_common = "0.19.2" twox-hash = "1.5.0" -sqlparser = "0.5.0" \ No newline at end of file +sqlparser = "0.9.0" \ No newline at end of file diff --git a/rdbc-mysql/src/lib.rs b/rdbc-mysql/src/lib.rs index b53a6f5..5af887a 100644 --- a/rdbc-mysql/src/lib.rs +++ b/rdbc-mysql/src/lib.rs @@ -21,6 +21,7 @@ use mysql as my; use mysql_common::constants::ColumnType; use sqlparser::dialect::MySqlDialect; +use sqlparser::dialect::keywords::Keyword; use sqlparser::tokenizer::{Token, Tokenizer, Word}; /// Convert a MySQL error into an RDBC error @@ -222,7 +223,7 @@ fn rewrite(sql: &str, params: &[rdbc::Value]) -> rdbc::Result { Token::Word(Word { value: param.to_string(), quote_style: None, - keyword: "".to_owned(), + keyword: Keyword::NoKeyword, }) } _ => t.clone(), diff --git a/rdbc-postgres/Cargo.toml b/rdbc-postgres/Cargo.toml index 71601a9..050aea6 100644 --- a/rdbc-postgres/Cargo.toml +++ b/rdbc-postgres/Cargo.toml @@ -11,4 +11,4 @@ edition = "2018" rdbc = { path = "../rdbc", version = "0.1.6" } postgres = "0.15.2" -sqlparser = "0.5.0" \ No newline at end of file +sqlparser = "0.9.0" \ No newline at end of file diff --git a/rdbc-postgres/src/lib.rs b/rdbc-postgres/src/lib.rs index 6b9ebf5..8d185f5 100644 --- a/rdbc-postgres/src/lib.rs +++ b/rdbc-postgres/src/lib.rs @@ -21,6 +21,7 @@ use postgres::rows::Rows; use postgres::{Connection, TlsMode}; use sqlparser::dialect::PostgreSqlDialect; +use sqlparser::dialect::keywords::Keyword; use sqlparser::tokenizer::{Token, Tokenizer, Word}; use postgres::types::Type; @@ -70,7 +71,7 @@ impl rdbc::Connection for PConnection { Token::Word(Word { value: format!("${}", i), quote_style: None, - keyword: "".to_owned(), + keyword: Keyword::NoKeyword, }) } _ => t.clone(),