Commit Graph

134 Commits

Author SHA1 Message Date
program-- 9a531a8945 fix: set package module to nil in lua namespace; prevents calling loaders 2022-11-09 13:50:43 -08:00
program-- ab8e1cc202 fix: handle EVAL vulnerability; open subset of lua modules 2022-11-09 13:33:37 -08:00
tidwall 9c471e3f9c Replace out old style atomics 2022-11-03 10:07:17 -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
tidwall 2075bbeae4 Allow for queries GeoJSON properties
This commit allows for performing WHERE on the object's GeoJSON
properties member.

For example:

    SET fleet truck1 OBJECT '{"type":"Feature","geometry":{"type":"Point","coordinates":[-112,33]},"properties":{"speed":50}}'

You can now do:

    SCAN fleet WHERE properties.speed > 50
2022-10-20 14:26:34 -07:00
tidwall 959f551f7b Increase timeout for slow CIs 2022-10-20 11:23:54 -07:00
tidwall cf7f49fd9b Add field path queries for json and comparison operators
It's now possible to query a JSON field using a GJSON path.

   SET fleet truck1 FIELD props '{"speed":58,"name":"Andy"}' POINT 33 -112

You can then use the GJSON type path to return the objects that match the WHERE.

   SCAN fleet WHERE props.speed 50 inf
   SCAN fleet WHERE props.name Andy Andy

Included in this commit is support for '==', '<', '>', '<=', '>=', and '!='.
The previous queries could be written like:

    SCAN fleet WHERE props.speed > 50
    SCAN fleet WHERE props.name == Andy
2022-10-20 11:17:01 -07:00
tidwall 6b310cebb5 Fixed zero-field to deleting existing field 2022-10-19 04:36:17 -07:00
tidwall 0723eb5b9f Clean up test output 2022-09-27 14:42:52 -07:00
tidwall e1df4dbf78 Better OUTPUT tests 2022-09-27 14:19:57 -07:00
tidwall 77b4efa55f Better FOLLOW/MONITOR tests 2022-09-27 14:06:24 -07:00
tidwall 8e0bf1957d wip - follower tests 2022-09-27 13:09:28 -07:00
tidwall 06ebeecf4a Better AOFMIGRATE tests 2022-09-27 10:06:47 -07:00
tidwall cfc9673957 wip - Better AOFMIGRATE tests 2022-09-27 09:47:09 -07:00
tidwall 46927b476f Better TEST tests 2022-09-27 08:18:17 -07:00
tidwall 659160289c Better READONLY tests 2022-09-26 17:58:51 -07:00
tidwall 588207d162 Added AOFSHINK tests 2022-09-26 16:43:55 -07:00
tidwall ad8d40dee5 Better AOF/AOFMD5 tests 2022-09-26 15:43:14 -07:00
tidwall c093b041e1 Parallel integration tests 2022-09-26 13:26:46 -07:00
tidwall 3cb8e0509a Thread safe log and support for concurrent tile38 instances 2022-09-26 10:02:02 -07:00
tidwall 97da6d70c4 Moved metrics into step test 2022-09-25 06:34:27 -07:00
tidwall 906824323b More graceful Tile38 shutdown 2022-09-25 06:28:17 -07:00
tidwall f2c3b3924a wip - aof tests 2022-09-25 03:54:22 -07:00
tidwall 13ceb7da41 Removed global variables from core package
The core package uses global variables that keep from having
more than one Tile38 instance runnning in the same process.

Move the core variables in the server.Options type which are
uniquely stated per Server instance.

The build variables are still present in the core package.
2022-09-24 15:44:32 -07:00
tidwall 0301545fe6 Better INFO tests 2022-09-24 14:28:47 -07:00
tidwall d8ecbba0be Better CLIENT tests 2022-09-24 13:41:36 -07:00
tidwall e6cced4c4a Fix hang on empty RESP response 2022-09-24 07:22:39 -07:00
tidwall 5460998086 wip - fixing the empty response error 2022-09-24 06:22:58 -07:00
tidwall 9c8e7e90e1 Clean up some tests 2022-09-23 17:54:49 -07:00
tidwall 5c455cbe10 Better HEALTHZ tests 2022-09-23 17:34:09 -07:00
tidwall 5bcef43894 Better KEYS tests 2022-09-23 16:12:32 -07:00
tidwall 295a9c45a8 Better SET/PERSIST/TTL/STATS tests 2022-09-23 15:29:46 -07:00
tidwall 7fa2dc4419 Better FSET tests
Execute oom check immediately after setting maxmemory
2022-09-23 12:42:39 -07:00
tidwall d7ad01e593 Better FLUSHDB/EXPIRES tests 2022-09-23 11:40:48 -07:00
tidwall 960c860b3a Better RENAME/RENAMENX tests 2022-09-23 11:18:01 -07:00
tidwall ede1ce0269 Better GET/DROP tests 2022-09-23 10:42:43 -07:00
tidwall db380a4fee Better DEL/PDEL/TYPE tests 2022-09-23 09:04:01 -07:00
tidwall ef95f04aca Better coverage BOUNDS 2022-09-23 07:51:05 -07:00
tidwall d61f0bc6c8 wip - better tests 2022-09-23 07:30:03 -07:00
tidwall 2c643996e7 Immutable Object type 2022-09-20 14:20:53 -07:00
tidwall ba9a767988 Changed the collection rectangle dimension type
Previously used float64s, now using float32s.
Saving about 15% on rectangle memory.
Uses the Roundoff trick from Sqlite.
2022-09-19 17:51:14 -07:00
tidwall d5c148ca41 Field overhaul 2022-09-19 17:47:38 -07:00
Benjamin Ramser 33e8e28a83 feat: add distance to NEARBY IDS response 2022-09-17 11:02:20 +02:00
tidwall 3011b6ec45 Upgrade geojson dependency 2022-09-14 08:14:29 -07:00
tidwall 498bbe23ff Updated btree and rtree
This commit updates to the latest btree and rtree.

The rtree algorithm has been modified in `tidwall/rtree@v1.7`
which now keeps internal and leaf rect sorted by the min-x
coordinate. This make for much faster (up to 50%) faster
searches and replacements, but slightly slower inserts.

Because of the R-tree update, the tests needed to be updated to
account for the change in order for undeterministic WITHIN and
INTERSECTS commands.
2022-09-11 14:31:00 -07:00
tidwall f24c251ee6 Allow for multiple MATCH patterns
Each MATCH is inclusive OR, thus

    WITHIN fleet MATCH train* truck* BOUNDS 33 -112 34 -113

will find all trains and trucks that within the provides bounds.
2022-09-01 19:43:30 -07:00
tidwall 8e61f8163e Fix test on Apple silicon
The returned distance value for the kNN test was failing on a
Apple M1 machine. The test expected a hardcoded value.

amd64: 13053.885940801563
apple: 13053.885940801567

Not sure why the difference between the two cpus but I changed
the test to not compare for exact equality.
2022-06-16 16:02:37 -07:00
tidwall 241117c7ba Added BUFFER option for Within and Intersects
This commit allows for buffering any GeoJSON object.

For example:

    INTERSECTS fleet BUFFER 1000 OBJECT {...LineString...}

This will buffer add a 1 kilometer buffer to a linesting and
search the 'fleet' collection for all objects that
intersect the buffered linestring.

This commit also allows for performing INTERSECTS with a POINT
type. Thus allowing for a polygon-over-point operation, which is
an inverted point-in-polygon.
2021-12-09 18:14:50 -07:00
tidwall f9e6f74753 Use struct for server options 2021-09-29 07:19:00 -07:00
Benjamin Ramser c87fd4836e test: add more tests 2021-09-05 12:56:45 +02:00