Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions klickhouse/src/types/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -218,12 +218,21 @@ fn parse_args(input: &str) -> Result<Vec<&str>> {
let mut out = vec![];
let mut in_parens = 0usize;
let mut last_start = 0;
let mut spec_symbols_found = false;
// todo: handle parens in enum strings?
for (i, c) in input.char_indices() {
match c {
'\'' | '=' => spec_symbols_found = true, // exclude enum elements
' ' => {
if in_parens == 0 && !spec_symbols_found {
// this is subcolumn name. skip it
last_start = i + 1;
}
}
',' => {
if in_parens == 0 {
out.push(input[last_start..i].trim());
spec_symbols_found = false;
last_start = i + 1;
}
}
Expand Down