jirutka / rsql-parser

Parser for RSQL / FIQL – query language for RESTful APIs
739 stars 157 forks source link

ability to pass nulls in rsql grammer #16

Closed gauravbrills closed 8 years ago

gauravbrills commented 8 years ago

Is there a syntax to pass nulls in rsql grammer

I try to pass something like say name==tom;ssn== to find names with no ssn but seems the parser gives an exception when there is no parameter post the == .This I am using to pass null values int eh expression .

Is there any way to do this or will it need to be added as an exception in the parser to handle null queries .

jirutka commented 8 years ago

You can use e.g. ssn==null and handle it in a converter. RSQL parser is not responsible for interpreting comparison arguments, it just pass them as a string value to a converter.

gauravbrills commented 8 years ago

@jirutka thanks for the clarification . Think then we will have to define a custom logic or nomenclature for nulls in our API .

jirutka commented 8 years ago

Yeah, you surely already have some logic to convert numeric arguments into Integers, dates into some Date type... this is basically the same, it's just a type conversion.