mirror of
https://github.com/tursodatabase/limbo.git
synced 2025-12-23 08:21:09 +00:00
remove quotes handling from normalization util
This commit is contained in:
parent
86a95e813d
commit
00114d9674
1 changed files with 3 additions and 10 deletions
13
core/util.rs
13
core/util.rs
|
|
@ -112,16 +112,9 @@ const QUOTE_PAIRS: &[(char, char)] = &[
|
|||
];
|
||||
|
||||
pub fn normalize_ident(identifier: &str) -> String {
|
||||
let quote_pair = QUOTE_PAIRS
|
||||
.iter()
|
||||
.find(|&(start, end)| identifier.starts_with(*start) && identifier.ends_with(*end));
|
||||
|
||||
if let Some(&(_, _)) = quote_pair {
|
||||
&identifier[1..identifier.len() - 1]
|
||||
} else {
|
||||
identifier
|
||||
}
|
||||
.to_lowercase()
|
||||
// quotes normalization already happened in the parser layer (see Name ast node implementation)
|
||||
// so, we only need to convert identifier string to lowercase
|
||||
identifier.to_lowercase().to_lowercase()
|
||||
}
|
||||
|
||||
pub const PRIMARY_KEY_AUTOMATIC_INDEX_NAME_PREFIX: &str = "sqlite_autoindex_";
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue