Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(77)

Unified Diff: lib/src/datastore_impl.dart

Issue 2731933004: Remove FilterRelation.In / "property IN" queries, upgrade googleapis{,_beta} dependencies (Closed)
Patch Set: add pubspec.yaml update Created 3 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « lib/datastore.dart ('k') | lib/src/db/annotations.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: lib/src/datastore_impl.dart
diff --git a/lib/src/datastore_impl.dart b/lib/src/datastore_impl.dart
index edb7e7a5eb2a146cc0141d344c4a0498cccb1459..d2045fd8b6429eb775ba35749f6f37faae64033b 100644
--- a/lib/src/datastore_impl.dart
+++ b/lib/src/datastore_impl.dart
@@ -210,34 +210,18 @@ class DatastoreImpl implements datastore.Datastore {
datastore.FilterRelation.Equal: 'EQUAL',
datastore.FilterRelation.GreatherThan: 'GREATER_THAN',
datastore.FilterRelation.GreatherThanOrEqual: 'GREATER_THAN_OR_EQUAL',
- // TODO(Issue #5): IN operator not supported currently.
};
api.Filter _convertDatastore2ApiFilter(datastore.Filter filter) {
var pf = new api.PropertyFilter();
var operator = relationMapping[filter.relation];
- // FIXME(Issue #5): Is this OK?
- if (filter.relation == datastore.FilterRelation.In) {
- operator = 'EQUAL';
- }
-
if (operator == null) {
throw new ArgumentError('Unknown filter relation: ${filter.relation}.');
}
pf.op = operator;
pf.property = new api.PropertyReference()..name = filter.name;
-
- // FIXME(Issue #5): Is this OK?
- var value = filter.value;
- if (filter.relation == datastore.FilterRelation.In) {
- if (value is List && value.length == 1) {
- value = value.first;
- } else {
- throw new ArgumentError('List values not supported (was: $value).');
- }
- }
-
- pf.value = _convertDatastore2ApiPropertyValue(value, true, lists: false);
+ pf.value = _convertDatastore2ApiPropertyValue(
+ filter.value, true, lists: false);
return new api.Filter()..propertyFilter = pf;
}
« no previous file with comments | « lib/datastore.dart ('k') | lib/src/db/annotations.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698