pub struct TableRef {
pub schema_name: Option<String>,
pub schema_quoted: bool,
pub name: String,
pub quoted: bool,
}Expand description
A reference to a table name with case-sensitivity information.
This struct captures whether an identifier was quoted (delimited) in the original SQL, which is necessary for correct SQL:1999 case handling:
- Unquoted identifiers: Case-insensitive (e.g.,
MyTable,mytable,MYTABLEare equivalent) - Quoted identifiers: Case-sensitive (e.g.,
"MyTable"is different from"mytable")
§Example
use vibesql_ast::TableRef;
// Unquoted: case-insensitive
let unquoted = TableRef::new("MyTable".to_string(), false);
// Quoted: case-sensitive
let quoted = TableRef::new("MyTable".to_string(), true);Fields§
§schema_name: Option<String>Optional schema name for qualified references (e.g., schema.table)
schema_quoted: boolWhether the schema name was quoted (delimited) in the original SQL.
name: StringThe table name as written in the SQL
quoted: boolWhether the identifier was quoted (delimited) in the original SQL.
true: Quoted identifier (case-sensitive), e.g.,"MyTable"false: Unquoted identifier (case-insensitive), e.g.,MyTable
Implementations§
Source§impl TableRef
impl TableRef
Sourcepub fn qualified(
schema_name: String,
schema_quoted: bool,
table_name: String,
table_quoted: bool,
) -> Self
pub fn qualified( schema_name: String, schema_quoted: bool, table_name: String, table_quoted: bool, ) -> Self
Create a qualified table reference with schema.
Sourcepub fn quoted_ref(name: String) -> Self
pub fn quoted_ref(name: String) -> Self
Create a quoted (case-sensitive) table reference.
Sourcepub fn is_any_quoted(&self) -> bool
pub fn is_any_quoted(&self) -> bool
Check if any part is quoted
Trait Implementations§
impl StructuralPartialEq for TableRef
Auto Trait Implementations§
impl Freeze for TableRef
impl RefUnwindSafe for TableRef
impl Send for TableRef
impl Sync for TableRef
impl Unpin for TableRef
impl UnwindSafe for TableRef
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more