rosostolato / odata-fluent-query

odata query builder
MIT License
37 stars 8 forks source link

#Feature add fromString() function that creates an ODataQuery object #22

Open alexbu92 opened 2 years ago

alexbu92 commented 2 years ago

There's no way currently to do the opposite of the toString() method, which is parse a string generated by the toString method and recreate an ODataQuery object.

rosostolato commented 2 years ago

I'm curious, what is the use case for it?

alexbu92 commented 2 years ago

I'm curious, what is the use case for it?

I'm making an odata-elasticsearch adapter. Query gets built on the client, converted to string and sent to server, server then needs to parse it back to OData and then I would have a service that converts an OdataQuery to an elasticsearch query.

rosostolato commented 2 years ago

Got it, for that we would need a great regex parser. Can you help us developing this and push a PR?