pub struct Name { /* private fields */ }Expand description
identifier or string or CROSS or FULL or INNER or LEFT or NATURAL or OUTER or RIGHT.
Two Names are equal if they refer to the same identifier, regardless of
quoting style (e.g. ABORT and "ABORT" are the same identifier).
Implementations§
Source§impl Name
impl Name
Sourcepub fn exact(s: String) -> Self
pub fn exact(s: String) -> Self
Create name which will have exactly the value of given string (e.g. if s = “"str"” - the name value will contain quotes and translation to SQL will give us “”“str”“”)
Sourcepub fn from_bytes(s: &[u8]) -> Self
pub fn from_bytes(s: &[u8]) -> Self
Parse name from the bytes (e.g. handle quoting and handle escaped quotes)
pub const fn empty() -> Self
Sourcepub fn from_string(s: impl AsRef<str>) -> Self
pub fn from_string(s: impl AsRef<str>) -> Self
Parse name from the string (e.g. handle quoting and handle escaped quotes)
Sourcepub fn as_literal(&self) -> String
pub fn as_literal(&self) -> String
Convert value to the string literal (e.g. single-quoted string with escaped single quotes)
Sourcepub fn as_ident(&self) -> String
pub fn as_ident(&self) -> String
Convert value to the name string (e.g. double-quoted string with escaped double quotes)
Sourcepub fn quoted_with(&self, quote: char) -> bool
pub fn quoted_with(&self, quote: char) -> bool
Checks if a name represents a quoted string that should get fallback behavior Need to detect legacy conversion of double quoted keywords to string literals (see https://sqlite.org/lang_keywords.html)
Also, used to detect string literals in PRAGMA cases