Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Enable parsing of SQL query with where condition with multiples IN from oracle sintax #7

Open
renatobenks-zz opened this issue Jan 25, 2018 · 1 comment · May be fixed by #8
Open

Comments

@renatobenks-zz
Copy link
Contributor

How we could support this query? It's a new query sintax?

select fieldA from table where (fieldB, fieldC) in ((1 , 2))
@haskellcamargo
Copy link
Contributor

The grammar for what you want is defined here.

InConditions

ExpressionList

So, you need to:

  • Register the IN keyword here
  • Create a new rule called ExpressionList where:
ExpressionList: [
  o 'Expression' -> [$1]
  o 'ExpressionList SEPARATOR Expression' -> new ExpressionList($1.concat($3))
  o 'LEFT_PAREN ExpressionList RIGHT_PAREN' -> $2
]
  • Create rule InConditions according to the grammar, like I did for expressions
  • Create AST nodes InConditions and ExpressionList
  • Add InConditions rule as a possibility for WHERE clause
  • Create string representation for the new AST nodes

Don't forget to write tests for it!

@renatobenks-zz renatobenks-zz changed the title Enable parsing of SQL query with multiples where with from oracle sintax Enable parsing of SQL query with where condition with multiples IN from oracle sintax Mar 24, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants