Answer the question
In order to leave comments, you need to log in
How to implement filtering records based on SQL like text?
Good day!
The challenge was that
the API should support filtering using parentheses to determine the precedence of conditions and using any combination of available fields. Need to support AND, OR, EQUALS, NOT EQUALS, GREATER THAN, LOWER THAN operations.
Example: (date eq '2016-05-01') AND ((distance gt 20) OR (distance lt 10)).
That is, there are several different methods for obtaining data, all of them must support filtering of this kind, and for each type of returned data there is a set of fields for which filtering is available.
Are there any standard tools that can be useful for implementing such a thing?
Of course, you need to check the correctness of the query syntax and check that there are no SQL injections <- This can be done through query validation with regex.
Does anyone have any helpful thoughts? On .NET, ADO.NET, Entity Framework.
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question