diff --git a/vendored/sqlite3-parser/src/lib.rs b/vendored/sqlite3-parser/src/lib.rs index 0beea1263..d5634f9c2 100644 --- a/vendored/sqlite3-parser/src/lib.rs +++ b/vendored/sqlite3-parser/src/lib.rs @@ -6,3 +6,4 @@ pub mod dialect; pub mod lexer; mod parser; pub use parser::ast; +pub mod to_sql_string; diff --git a/vendored/sqlite3-parser/src/to_sql_string/mod.rs b/vendored/sqlite3-parser/src/to_sql_string/mod.rs new file mode 100644 index 000000000..df0feb601 --- /dev/null +++ b/vendored/sqlite3-parser/src/to_sql_string/mod.rs @@ -0,0 +1,16 @@ +//! ToSqlString trait definition and implementations + +use crate::ast::TableInternalId; + +/// Context to be used in ToSqlString +pub trait ToSqlContext { + /// Given an id, get the table name + /// Currently not considering alias + fn get_table_name(&self, id: TableInternalId) -> &str; +} + +/// Trait to convert an ast to a string +pub trait ToSqlString { + /// Convert the given value to String + fn to_sql_string(&self, context: &C) -> String; +}