Skip to content

Commit

Permalink
fix(starfish): Add bitwise operator support to SQL parser (#54894)
Browse files Browse the repository at this point in the history
These show up on occasion!
  • Loading branch information
gggritso authored Aug 17, 2023
1 parent d5615b9 commit 8e90ede
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
4 changes: 4 additions & 0 deletions static/app/views/starfish/utils/sqlish/SQLishParser.spec.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,10 @@ describe('SQLishParser', function () {
'created >= %s', // Python-style
'created >= $1', // Rails-style
'@@ to_tsquery', // Postgres full-text search
'flags & %s)', // Bitwise AND
'flags | %s)', // Bitwise OR
'flags ^ %s)', // Bitwise XOR
'flags ~ %s)', // Bitwise NOT
])('Parses %s', sql => {
expect(() => {
parser.parse(sql);
Expand Down
2 changes: 1 addition & 1 deletion static/app/views/starfish/utils/sqlish/sqlish.pegjs
Original file line number Diff line number Diff line change
Expand Up @@ -36,4 +36,4 @@ Whitespace
= Whitespace:[\n\t ]+ { return { type: 'Whitespace', content: Whitespace.join("") } }

GenericToken
= GenericToken:[a-zA-Z0-9"'`_\-.=><:,*;!\[\]?$%|/@]+ { return { type: 'GenericToken', content: GenericToken.join('') } }
= GenericToken:[a-zA-Z0-9"'`_\-.=><:,*;!\[\]?$%|/@&~^]+ { return { type: 'GenericToken', content: GenericToken.join('') } }

0 comments on commit 8e90ede

Please sign in to comment.