Commit Graph

4 Commits

Author SHA1 Message Date
tidwall aa1caa6131 Use zero for undefined fields in where expressions
This commit fixes an issue where expressions were
silently failing when encountering undefined fields.
Instead they should be treating the undefined field like
the number zero. This is required to stay compatible with
how Tile38 handles zeros.
https://tile38.com/commands/intersects/#fields

Fixes #754
2024-11-05 14:03:23 -07:00
tidwall bd8d8cdc77 Ensure case-insensitve compares 2022-11-22 07:41:33 -07:00
tidwall 54590bb452 Add match method to expressions
SCAN fleet WHERE "properties.speed > 45 && id.match('truck*')"
2022-10-21 04:20:46 -07:00
tidwall bdc80a7f70 Added WHERE expressions
It's now possible to do:

   SCAN fleet WHERE "properties.speed < 25 || properties.speed > 50"

Uses javascript-like syntax using the https://github.com/tidwall/expr package.

Automatically reference fields and GeoJSON properties:

   SET fleet truck1 FIELD speed 65 POINT -112 33

Can be queried:

   SCAN fleet WHERE "speed > 50"
   SCAN fleet WHERE "id == 'truck1'"
   SCAN fleet WHERE "speed > 50 && id == 'truck1'"
2022-10-20 17:01:12 -07:00