mirror of
https://github.com/aljazceru/turso.git
synced 2026-02-23 08:55:40 +01:00
to_sql_string trait definition
This commit is contained in:
@@ -6,3 +6,4 @@ pub mod dialect;
|
||||
pub mod lexer;
|
||||
mod parser;
|
||||
pub use parser::ast;
|
||||
pub mod to_sql_string;
|
||||
|
||||
16
vendored/sqlite3-parser/src/to_sql_string/mod.rs
Normal file
16
vendored/sqlite3-parser/src/to_sql_string/mod.rs
Normal file
@@ -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<C: ToSqlContext> {
|
||||
/// Convert the given value to String
|
||||
fn to_sql_string(&self, context: &C) -> String;
|
||||
}
|
||||
Reference in New Issue
Block a user