initial stubs for ast::Select

This commit is contained in:
pedrocarlo
2025-05-26 18:18:00 -03:00
parent 2ac2990b4c
commit 1dc73bc49e
3 changed files with 43 additions and 3 deletions

View File

@@ -1,16 +1,19 @@
//! ToSqlString trait definition and implementations
mod stmt;
use crate::ast::TableInternalId;
/// Context to be used in ToSqlString
pub trait ToSqlContext {
/// Given an id, get the table name
/// Currently not considering alias
///
/// Currently not considering aliases
fn get_table_name(&self, id: TableInternalId) -> &str;
}
/// Trait to convert an ast to a string
pub trait ToSqlString<C: ToSqlContext> {
pub trait ToSqlString {
/// Convert the given value to String
fn to_sql_string(&self, context: &C) -> String;
fn to_sql_string<C: ToSqlContext>(&self, context: &C) -> String;
}