tylerhubert / rsql-criteria-typescript

RSQL Criteria Builder for Typescript
MIT License
13 stars 5 forks source link

Operation EqualTo works uncorrect. You use =in= instead == #7

Closed ezhuikova closed 5 years ago

ezhuikova commented 5 years ago

https://github.com/tylerhubert/rsql-criteria-typescript/blob/15353bb682fb6e1fac41fa5fc034ea4ccafbf210/src/files/rsql-filter-expression.ts#L67

tylerhubert commented 5 years ago

Can you please give some more context on why this is causing a problem for you?

This change was intentional due to a problem that was found when working with https://github.com/tennaito/rsql-jpa on the backend. It converts == into a SQL LIKE operation. This causes problems when the search criteria contains a SQL wildcard in it. To fix this, a one parameter =in= gets converted into an = in SQL, so I've changed the UI library over to handle that.

If you would like to continue having the front-end produce == syntax, the like function is available that does this. https://github.com/tylerhubert/rsql-criteria-typescript/blob/master/src/files/rsql-filter-expression.ts#L73

This functionality is also noted in the README: https://github.com/tylerhubert/rsql-criteria-typescript#a-note-on-function-names

If a change is needed we can look at making a change, but some more context would be appreciated to fully understand the problem.