-
Notifications
You must be signed in to change notification settings - Fork 41
Open
Description
As I read from the code, currently, Instream.Query.Builder where clause only supports equal operator. It should support more operators like >, <, >=, <=
One idea is for each {key, value} pair in the where conditions map, the key can be a string with format "field[space]op" whereas op is either ">", "<", ">=" nor "<=". If the key is an atom or op is omitted, we can consider the operator is equal.
For example:
# SELECT * FROM some_measurement WHERE binary = 'foo' AND numeric >= 42 AND location = 'abc'
from("some_measurement")
|> where(%{ binary: "foo", "numeric >=": 42, "location": "abc" })
|> MyApp.MyConnection.query()
Query Builder should also support LIMIT and OFFSET clauses
For example:
# SELECT * FROM some_measurement WHERE binary = 'foo' LIMIT 15 OFFSET 78
from("some_measurement")
|> where(%{ binary: "foo"})
|> limit(15)
|> offset(78)
|> MyApp.MyConnection.query()
If you don't mind, I can create a PR for this
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels