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

Side by Side Diff: service/datastore/finalized_query.go

Issue 1957953002: Add cloud datastore implementation. (Closed) Base URL: https://chromium.googlesource.com/external/github.com/luci/gae@master
Patch Set: Adjust minimum coverage. Created 4 years, 5 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 unified diff | Download patch
« no previous file with comments | « pre-commit-go.yml ('k') | service/datastore/raw_interface.go » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2015 The LUCI Authors. All rights reserved. 1 // Copyright 2015 The LUCI Authors. All rights reserved.
2 // Use of this source code is governed under the Apache License, Version 2.0 2 // Use of this source code is governed under the Apache License, Version 2.0
3 // that can be found in the LICENSE file. 3 // that can be found in the LICENSE file.
4 4
5 package datastore 5 package datastore
6 6
7 import ( 7 import (
8 "bytes" 8 "bytes"
9 "fmt" 9 "fmt"
10 "sort" 10 "sort"
(...skipping 135 matching lines...) Expand 10 before | Expand all | Expand 10 after
146 146
147 // IneqFilterProp returns the inequality filter property name, if one is used 147 // IneqFilterProp returns the inequality filter property name, if one is used
148 // for this filter. An empty return value means that this query does not 148 // for this filter. An empty return value means that this query does not
149 // contain any inequality filters. 149 // contain any inequality filters.
150 func (q *FinalizedQuery) IneqFilterProp() string { 150 func (q *FinalizedQuery) IneqFilterProp() string {
151 return q.ineqFiltProp 151 return q.ineqFiltProp
152 } 152 }
153 153
154 // IneqFilterLow returns the field name, operator and value for the low-side 154 // IneqFilterLow returns the field name, operator and value for the low-side
155 // inequality filter. If the returned field name is "", it means that there's 155 // inequality filter. If the returned field name is "", it means that there's
156 // now lower inequality bound on this query. 156 // no lower inequality bound on this query.
157 // 157 //
158 // If field is non-empty, op may have the values ">" or ">=". 158 // If field is non-empty, op may have the values ">" or ">=".
159 func (q *FinalizedQuery) IneqFilterLow() (field, op string, val Property) { 159 func (q *FinalizedQuery) IneqFilterLow() (field, op string, val Property) {
160 if q.ineqFiltLowSet { 160 if q.ineqFiltLowSet {
161 field = q.ineqFiltProp 161 field = q.ineqFiltProp
162 val = q.ineqFiltLow 162 val = q.ineqFiltLow
163 op = ">" 163 op = ">"
164 if q.ineqFiltLowIncl { 164 if q.ineqFiltLowIncl {
165 op = ">=" 165 op = ">="
166 } 166 }
167 } 167 }
168 return 168 return
169 } 169 }
170 170
171 // IneqFilterHigh returns the field name, operator and value for the high-side 171 // IneqFilterHigh returns the field name, operator and value for the high-side
172 // inequality filter. If the returned field name is "", it means that there's 172 // inequality filter. If the returned field name is "", it means that there's
173 // now upper inequality bound on this query. 173 // no upper inequality bound on this query.
174 // 174 //
175 // If field is non-empty, op may have the values "<" or "<=". 175 // If field is non-empty, op may have the values "<" or "<=".
176 func (q *FinalizedQuery) IneqFilterHigh() (field, op string, val Property) { 176 func (q *FinalizedQuery) IneqFilterHigh() (field, op string, val Property) {
177 if q.ineqFiltHighSet { 177 if q.ineqFiltHighSet {
178 field = q.ineqFiltProp 178 field = q.ineqFiltProp
179 val = q.ineqFiltHigh 179 val = q.ineqFiltHigh
180 op = "<" 180 op = "<"
181 if q.ineqFiltHighIncl { 181 if q.ineqFiltHighIncl {
182 op = "<=" 182 op = "<="
183 } 183 }
(...skipping 146 matching lines...) Expand 10 before | Expand all | Expand 10 after
330 if q.ineqFiltProp == "__key__" { 330 if q.ineqFiltProp == "__key__" {
331 if q.ineqFiltLowSet && !q.ineqFiltLow.Value().(*Key).Valid(false , aid, ns) { 331 if q.ineqFiltLowSet && !q.ineqFiltLow.Value().(*Key).Valid(false , aid, ns) {
332 return ErrInvalidKey 332 return ErrInvalidKey
333 } 333 }
334 if q.ineqFiltHighSet && !q.ineqFiltHigh.Value().(*Key).Valid(fal se, aid, ns) { 334 if q.ineqFiltHighSet && !q.ineqFiltHigh.Value().(*Key).Valid(fal se, aid, ns) {
335 return ErrInvalidKey 335 return ErrInvalidKey
336 } 336 }
337 } 337 }
338 return nil 338 return nil
339 } 339 }
OLDNEW
« no previous file with comments | « pre-commit-go.yml ('k') | service/datastore/raw_interface.go » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698