thevahidal / soul

🕉 A SQLite REST and realtime server
https://thevahidal.github.io/soul/
MIT License
1.51k stars 51 forks source link

Fix bug in comparison operators #136

Closed AbegaM closed 1 year ago

AbegaM commented 1 year ago

PR Sponsored By @IanMayo

Fixes #135

Modifications

The comparison operators gte, lte, gt, and lt were not working for string values with a hyphen. I have changed the regex syntax.

IanMayo commented 1 year ago

Sorry Abenezer, I'm nervous about the changes here, and the risk of this fix breaking something else: image

Aah, we do have our unit tests, they should verify that existing functionality isn't broken.

Talking of which could you please introduce a test in rows.test.js that verifies this is working?

AbegaM commented 1 year ago

@IanMayo No problem, let me run the test and i will add additional tests if necessary

IanMayo commented 1 year ago

I've checked out your branch locally, but this query still returns invoices dated 2009:

http://localhost:8000/api/tables/invoices/rows?_filters=InvoiceDate__gte:2030
IanMayo commented 1 year ago

The regex was introduced to allow filter ids to be expressed as an array _filters:invoiceId:[22,33]. I confirm this is still working with the new regex.

thevahidal commented 1 year ago

Thanks for the PR @AbegaM, can you please bump the version so we can merge it?