Skip to content

Commit

Permalink
Fix quoting in set keyspace response and parsing of some identifier e…
Browse files Browse the repository at this point in the history
…scapes (#127)
  • Loading branch information
ikehara authored Jul 29, 2024
1 parent b1c54af commit 0dea6ff
Show file tree
Hide file tree
Showing 5 changed files with 2,059 additions and 2,032 deletions.
14 changes: 14 additions & 0 deletions parser/identifier.go
Original file line number Diff line number Diff line change
Expand Up @@ -44,3 +44,17 @@ func (i Identifier) equal(id string) bool {
func (i Identifier) isEmpty() bool {
return len(i.id) == 0
}

func (i Identifier) String() string {
if i.ignoreCase {
return i.id
}
return "\"" + i.id + "\""
}

func (i Identifier) ID() string {
if i.ignoreCase {
return strings.ToLower(i.id)
}
return strings.ReplaceAll(i.id, "\"\"", "\"")
}
Loading

0 comments on commit 0dea6ff

Please sign in to comment.