-
Notifications
You must be signed in to change notification settings - Fork 148
Add time between queries #268
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from 6 commits
053e7a2
32dc4cb
42244c0
8bed8aa
42bdb87
47f4915
538adb2
0706359
793a68d
bcad562
cead932
69901ef
f644d26
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -111,6 +111,10 @@ class Query { | |
| static String createdAfter(String value) => | ||
| Query._('createdAfter', null, value).toString(); | ||
|
|
||
| /// Filter resources where document was created between [start] and [end] (inclusive). | ||
| static String createdBetween(String start, String end) => | ||
| Query._('createdBetween', null, [start, end]).toString(); | ||
|
|
||
| /// Filter resources where document was updated before [value]. | ||
| static String updatedBefore(String value) => | ||
| Query._('updatedBefore', null, value).toString(); | ||
|
|
@@ -119,6 +123,10 @@ class Query { | |
| static String updatedAfter(String value) => | ||
| Query._('updatedAfter', null, value).toString(); | ||
|
|
||
| /// Filter resources where document was updated between [start] and [end] (inclusive). | ||
| static String updatedBetween(String start, String end) => | ||
| Query._('updatedBetween', null, [start, end]).toString(); | ||
|
|
||
| static String or(List<String> queries) => Query._( | ||
| 'or', | ||
| null, | ||
|
|
@@ -166,4 +174,84 @@ class Query { | |
| /// docs for more information. | ||
| static String offset(int offset) => | ||
| Query._('offset', null, offset).toString(); | ||
|
|
||
| /// Filter resources where [attribute] is at a specific distance from the given coordinates. | ||
| static String distanceEqual( | ||
| String attribute, | ||
| List<dynamic> values, | ||
| double distance, [ | ||
| bool meters = true, | ||
| ]) => Query._('distanceEqual', attribute, [ | ||
| values, | ||
| distance, | ||
| meters, | ||
| ]).toString(); | ||
|
|
||
| /// Filter resources where [attribute] is not at a specific distance from the given coordinates. | ||
| static String distanceNotEqual( | ||
| String attribute, | ||
| List<dynamic> values, | ||
| double distance, [ | ||
| bool meters = true, | ||
| ]) => Query._('distanceNotEqual', attribute, [ | ||
| values, | ||
| distance, | ||
| meters, | ||
| ]).toString(); | ||
|
|
||
| /// Filter resources where [attribute] is at a distance greater than the specified value from the given coordinates. | ||
| static String distanceGreaterThan( | ||
| String attribute, | ||
| List<dynamic> values, | ||
| double distance, [ | ||
| bool meters = true, | ||
| ]) => Query._('distanceGreaterThan', attribute, [ | ||
| values, | ||
| distance, | ||
| meters, | ||
| ]).toString(); | ||
|
|
||
| /// Filter resources where [attribute] is at a distance less than the specified value from the given coordinates. | ||
| static String distanceLessThan( | ||
| String attribute, | ||
| List<dynamic> values, | ||
| double distance, [ | ||
| bool meters = true, | ||
| ]) => Query._('distanceLessThan', attribute, [ | ||
| values, | ||
| distance, | ||
| meters, | ||
| ]).toString(); | ||
|
|
||
| /// Filter resources where [attribute] intersects with the given geometry. | ||
| static String intersects(String attribute, List<dynamic> values) => | ||
| Query._('intersects', attribute, values).toString(); | ||
|
|
||
| /// Filter resources where [attribute] does not intersect with the given geometry. | ||
| static String notIntersects(String attribute, List<dynamic> values) => | ||
| Query._('notIntersects', attribute, values).toString(); | ||
|
|
||
| /// Filter resources where [attribute] crosses the given geometry. | ||
| static String crosses(String attribute, List<dynamic> values) => | ||
| Query._('crosses', attribute, values).toString(); | ||
|
|
||
| /// Filter resources where [attribute] does not cross the given geometry. | ||
| static String notCrosses(String attribute, List<dynamic> values) => | ||
| Query._('notCrosses', attribute, values).toString(); | ||
|
|
||
| /// Filter resources where [attribute] overlaps with the given geometry. | ||
| static String overlaps(String attribute, List<dynamic> values) => | ||
| Query._('overlaps', attribute, values).toString(); | ||
|
|
||
| /// Filter resources where [attribute] does not overlap with the given geometry. | ||
| static String notOverlaps(String attribute, List<dynamic> values) => | ||
| Query._('notOverlaps', attribute, values).toString(); | ||
|
|
||
| /// Filter resources where [attribute] touches the given geometry. | ||
| static String touches(String attribute, List<dynamic> values) => | ||
| Query._('touches', attribute, values).toString(); | ||
|
|
||
| /// Filter resources where [attribute] does not touch the given geometry. | ||
| static String notTouches(String attribute, List<dynamic> values) => | ||
| Query._('notTouches', attribute, values).toString(); | ||
|
||
| } | ||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
💡 Verification agent
🧩 Analysis chain
Fix createdBetween/updatedBetween to use supported operators.
The server doesn’t expose “createdBetween”/“updatedBetween” operators. Use between() on $createdAt/$updatedAt instead to keep inclusive semantics documented in Queries. (appwrite.io)
Apply:
If tests assert the JSON method name equals "createdBetween"/"updatedBetween", update them to expect method "between" and attribute "$createdAt"/"$updatedAt", respectively.
Also applies to: 126-129
🏁 Script executed:
Length of output: 945
Use
betweenoperator for createdBetween/updatedBetween filters"createdBetween"/"updatedBetween"to expect"between"with attributes"$createdAt"/"$updatedAt".🤖 Prompt for AI Agents
💡 Verification agent
🧩 Analysis chain
Repo-wide verification for API compatibility.
Update tests/usage to match the supported shape; remove any geometry/distance usages.
Also applies to: 126-129, 178-224
🏁 Script executed:
Length of output: 7187
Remove unsupported geometry/distance filter methods
Delete the distance* and geometry filter helpers (distanceEqual/NotEqual/GreaterThan/LessThan and intersects/notIntersects/crosses/notCrosses/overlaps/notOverlaps/touches/notTouches) from lib/query.dart (lines 178–224).
🤖 Prompt for AI Agents