Answer the question
In order to leave comments, you need to log in
Parsing sql expression from a string
The project had a task to implement the ability to filter data in the API. The filter is a string. An example of the string "name LIKE 'Lesha' OR name LIKE 'Sasha' AND (age > 40 OR age < 30)"
This expression must be parsed and, using the structure already obtained
1., replace "age" "name" with the actual field names.
2. check the expression for correctness 3. create a new expression that will be passed along with the query to
the
database, while excluding sql
injections (algorithms)
Tell me useful libraries for parsing expressions from a string that can be customized to my needs.
Answer the question
In order to leave comments, you need to log in
zql.sourceforge.net/
jsqlparser.sourceforge.net/
sqljep.sourceforge.net/
www.playframework.com/documentation/2.0/ScalaAnorm
ANTLR3 + grammar from here or any other parser generator .
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question