Class: Appwrite::Query::Builder
- Inherits:
-
Object
- Object
- Appwrite::Query::Builder
- Defined in:
- lib/appwrite/query/builder.rb
Instance Method Summary collapse
- #and(queries) ⇒ Object
- #avg(attribute, alias_name = '') ⇒ Object
- #between(attribute, start, ending) ⇒ Object
- #bit_and(attribute, alias_name = '') ⇒ Object
- #bit_or(attribute, alias_name = '') ⇒ Object
- #bit_xor(attribute, alias_name = '') ⇒ Object
- #build ⇒ Object
- #contains(attribute, value) ⇒ Object
- #contains_all(attribute, value) ⇒ Object
- #contains_any(attribute, value) ⇒ Object
- #count(attribute = '*', alias_name = '') ⇒ Object
- #count_distinct(attribute, alias_name = '') ⇒ Object
- #covers(attribute, values) ⇒ Object
- #created_after(value) ⇒ Object
- #created_before(value) ⇒ Object
- #created_between(start, ending) ⇒ Object
- #cross_join(table, alias_name = '') ⇒ Object
- #crosses(attribute, values) ⇒ Object
- #cursor_after(id) ⇒ Object
- #cursor_before(id) ⇒ Object
- #distance_equal(attribute, values, distance, meters = true) ⇒ Object
- #distance_greater_than(attribute, values, distance, meters = true) ⇒ Object
- #distance_less_than(attribute, values, distance, meters = true) ⇒ Object
- #distance_not_equal(attribute, values, distance, meters = true) ⇒ Object
- #distinct ⇒ Object
- #elem_match(attribute, queries) ⇒ Object
- #ends_with(attribute, value) ⇒ Object
- #equal(attribute, value) ⇒ Object
- #exists(attributes) ⇒ Object
- #full_outer_join(table, left, right = '', operator = '=', alias_name = '') ⇒ Object
- #greater_than(attribute, value) ⇒ Object
- #greater_than_equal(attribute, value) ⇒ Object
- #group_by(attributes) ⇒ Object
- #having(queries) ⇒ Object
-
#initialize ⇒ Builder
constructor
A new instance of Builder.
- #intersects(attribute, values) ⇒ Object
- #is_not_null(attribute) ⇒ Object
- #is_null(attribute) ⇒ Object
- #join(table, left, right = '', operator = '=', alias_name = '') ⇒ Object
- #left_join(table, left, right = '', operator = '=', alias_name = '') ⇒ Object
- #less_than(attribute, value) ⇒ Object
- #less_than_equal(attribute, value) ⇒ Object
- #limit(limit) ⇒ Object
- #max(attribute, alias_name = '') ⇒ Object
- #min(attribute, alias_name = '') ⇒ Object
- #not_between(attribute, start, ending) ⇒ Object
- #not_contains(attribute, value) ⇒ Object
- #not_covers(attribute, values) ⇒ Object
- #not_crosses(attribute, values) ⇒ Object
- #not_ends_with(attribute, value) ⇒ Object
- #not_equal(attribute, value) ⇒ Object
- #not_exists(attributes) ⇒ Object
- #not_intersects(attribute, values) ⇒ Object
- #not_overlaps(attribute, values) ⇒ Object
- #not_search(attribute, value) ⇒ Object
- #not_spatial_equals(attribute, values) ⇒ Object
- #not_starts_with(attribute, value) ⇒ Object
- #not_touches(attribute, values) ⇒ Object
- #offset(offset) ⇒ Object
- #or(queries) ⇒ Object
- #order_asc(attribute) ⇒ Object
- #order_desc(attribute) ⇒ Object
- #order_random ⇒ Object
- #overlaps(attribute, values) ⇒ Object
- #page(page, per_page = 25) ⇒ Object
- #regex(attribute, pattern) ⇒ Object
- #relationship(attribute, queries) ⇒ Object
- #right_join(table, left, right = '', operator = '=', alias_name = '') ⇒ Object
- #search(attribute, value) ⇒ Object
- #select(attributes) ⇒ Object
- #spatial_equals(attribute, values) ⇒ Object
- #starts_with(attribute, value) ⇒ Object
- #stddev(attribute, alias_name = '') ⇒ Object
- #stddev_pop(attribute, alias_name = '') ⇒ Object
- #stddev_samp(attribute, alias_name = '') ⇒ Object
- #sum(attribute, alias_name = '') ⇒ Object
- #touches(attribute, values) ⇒ Object
- #updated_after(value) ⇒ Object
- #updated_before(value) ⇒ Object
- #updated_between(start, ending) ⇒ Object
- #var_pop(attribute, alias_name = '') ⇒ Object
- #var_samp(attribute, alias_name = '') ⇒ Object
- #variance(attribute, alias_name = '') ⇒ Object
- #vector_cosine(attribute, vector) ⇒ Object
- #vector_dot(attribute, vector) ⇒ Object
- #vector_euclidean(attribute, vector) ⇒ Object
Constructor Details
#initialize ⇒ Builder
Returns a new instance of Builder.
5 6 7 |
# File 'lib/appwrite/query/builder.rb', line 5 def initialize @queries = [] end |
Instance Method Details
#and(queries) ⇒ Object
165 166 167 |
# File 'lib/appwrite/query/builder.rb', line 165 def and(queries) return push(Query.and(queries)) end |
#avg(attribute, alias_name = '') ⇒ Object
237 238 239 |
# File 'lib/appwrite/query/builder.rb', line 237 def avg(attribute, alias_name = '') return push(Query.avg(attribute, alias_name)) end |
#between(attribute, start, ending) ⇒ Object
49 50 51 |
# File 'lib/appwrite/query/builder.rb', line 49 def between(attribute, start, ending) return push(Query.between(attribute, start, ending)) end |
#bit_and(attribute, alias_name = '') ⇒ Object
273 274 275 |
# File 'lib/appwrite/query/builder.rb', line 273 def bit_and(attribute, alias_name = '') return push(Query.bit_and(attribute, alias_name)) end |
#bit_or(attribute, alias_name = '') ⇒ Object
277 278 279 |
# File 'lib/appwrite/query/builder.rb', line 277 def bit_or(attribute, alias_name = '') return push(Query.bit_or(attribute, alias_name)) end |
#bit_xor(attribute, alias_name = '') ⇒ Object
281 282 283 |
# File 'lib/appwrite/query/builder.rb', line 281 def bit_xor(attribute, alias_name = '') return push(Query.bit_xor(attribute, alias_name)) end |
#build ⇒ Object
9 10 11 |
# File 'lib/appwrite/query/builder.rb', line 9 def build return @queries.dup end |
#contains(attribute, value) ⇒ Object
93 94 95 |
# File 'lib/appwrite/query/builder.rb', line 93 def contains(attribute, value) return push(Query.contains(attribute, value)) end |
#contains_all(attribute, value) ⇒ Object
101 102 103 |
# File 'lib/appwrite/query/builder.rb', line 101 def contains_all(attribute, value) return push(Query.contains_all(attribute, value)) end |
#contains_any(attribute, value) ⇒ Object
97 98 99 |
# File 'lib/appwrite/query/builder.rb', line 97 def contains_any(attribute, value) return push(Query.contains_any(attribute, value)) end |
#count(attribute = '*', alias_name = '') ⇒ Object
225 226 227 |
# File 'lib/appwrite/query/builder.rb', line 225 def count(attribute = '*', alias_name = '') return push(Query.count(attribute, alias_name)) end |
#count_distinct(attribute, alias_name = '') ⇒ Object
229 230 231 |
# File 'lib/appwrite/query/builder.rb', line 229 def count_distinct(attribute, alias_name = '') return push(Query.count_distinct(attribute, alias_name)) end |
#covers(attribute, values) ⇒ Object
329 330 331 |
# File 'lib/appwrite/query/builder.rb', line 329 def covers(attribute, values) return push(Query.covers(attribute, values)) end |
#created_after(value) ⇒ Object
141 142 143 |
# File 'lib/appwrite/query/builder.rb', line 141 def created_after(value) return push(Query.created_after(value)) end |
#created_before(value) ⇒ Object
137 138 139 |
# File 'lib/appwrite/query/builder.rb', line 137 def created_before(value) return push(Query.created_before(value)) end |
#created_between(start, ending) ⇒ Object
145 146 147 |
# File 'lib/appwrite/query/builder.rb', line 145 def created_between(start, ending) return push(Query.created_between(start, ending)) end |
#cross_join(table, alias_name = '') ⇒ Object
313 314 315 |
# File 'lib/appwrite/query/builder.rb', line 313 def cross_join(table, alias_name = '') return push(Query.cross_join(table, alias_name)) end |
#crosses(attribute, values) ⇒ Object
201 202 203 |
# File 'lib/appwrite/query/builder.rb', line 201 def crosses(attribute, values) return push(Query.crosses(attribute, values)) end |
#cursor_after(id) ⇒ Object
65 66 67 |
# File 'lib/appwrite/query/builder.rb', line 65 def cursor_after(id) return push(Query.cursor_after(id)) end |
#cursor_before(id) ⇒ Object
69 70 71 |
# File 'lib/appwrite/query/builder.rb', line 69 def cursor_before(id) return push(Query.cursor_before(id)) end |
#distance_equal(attribute, values, distance, meters = true) ⇒ Object
177 178 179 |
# File 'lib/appwrite/query/builder.rb', line 177 def distance_equal(attribute, values, distance, meters = true) return push(Query.distance_equal(attribute, values, distance, meters)) end |
#distance_greater_than(attribute, values, distance, meters = true) ⇒ Object
185 186 187 |
# File 'lib/appwrite/query/builder.rb', line 185 def distance_greater_than(attribute, values, distance, meters = true) return push(Query.distance_greater_than(attribute, values, distance, meters)) end |
#distance_less_than(attribute, values, distance, meters = true) ⇒ Object
189 190 191 |
# File 'lib/appwrite/query/builder.rb', line 189 def distance_less_than(attribute, values, distance, meters = true) return push(Query.distance_less_than(attribute, values, distance, meters)) end |
#distance_not_equal(attribute, values, distance, meters = true) ⇒ Object
181 182 183 |
# File 'lib/appwrite/query/builder.rb', line 181 def distance_not_equal(attribute, values, distance, meters = true) return push(Query.distance_not_equal(attribute, values, distance, meters)) end |
#distinct ⇒ Object
293 294 295 |
# File 'lib/appwrite/query/builder.rb', line 293 def distinct() return push(Query.distinct()) end |
#elem_match(attribute, queries) ⇒ Object
169 170 171 |
# File 'lib/appwrite/query/builder.rb', line 169 def elem_match(attribute, queries) return push(Query.elem_match(attribute, queries)) end |
#ends_with(attribute, value) ⇒ Object
57 58 59 |
# File 'lib/appwrite/query/builder.rb', line 57 def ends_with(attribute, value) return push(Query.ends_with(attribute, value)) end |
#equal(attribute, value) ⇒ Object
13 14 15 |
# File 'lib/appwrite/query/builder.rb', line 13 def equal(attribute, value) return push(Query.equal(attribute, value)) end |
#exists(attributes) ⇒ Object
129 130 131 |
# File 'lib/appwrite/query/builder.rb', line 129 def exists(attributes) return push(Query.exists(attributes)) end |
#full_outer_join(table, left, right = '', operator = '=', alias_name = '') ⇒ Object
309 310 311 |
# File 'lib/appwrite/query/builder.rb', line 309 def full_outer_join(table, left, right = '', operator = '=', alias_name = '') return push(Query.full_outer_join(table, left, right, operator, alias_name)) end |
#greater_than(attribute, value) ⇒ Object
29 30 31 |
# File 'lib/appwrite/query/builder.rb', line 29 def greater_than(attribute, value) return push(Query.greater_than(attribute, value)) end |
#greater_than_equal(attribute, value) ⇒ Object
33 34 35 |
# File 'lib/appwrite/query/builder.rb', line 33 def greater_than_equal(attribute, value) return push(Query.greater_than_equal(attribute, value)) end |
#group_by(attributes) ⇒ Object
285 286 287 |
# File 'lib/appwrite/query/builder.rb', line 285 def group_by(attributes) return push(Query.group_by(attributes)) end |
#having(queries) ⇒ Object
289 290 291 |
# File 'lib/appwrite/query/builder.rb', line 289 def having(queries) return push(Query.having(queries)) end |
#intersects(attribute, values) ⇒ Object
193 194 195 |
# File 'lib/appwrite/query/builder.rb', line 193 def intersects(attribute, values) return push(Query.intersects(attribute, values)) end |
#is_not_null(attribute) ⇒ Object
45 46 47 |
# File 'lib/appwrite/query/builder.rb', line 45 def is_not_null(attribute) return push(Query.is_not_null(attribute)) end |
#is_null(attribute) ⇒ Object
41 42 43 |
# File 'lib/appwrite/query/builder.rb', line 41 def is_null(attribute) return push(Query.is_null(attribute)) end |
#join(table, left, right = '', operator = '=', alias_name = '') ⇒ Object
297 298 299 |
# File 'lib/appwrite/query/builder.rb', line 297 def join(table, left, right = '', operator = '=', alias_name = '') return push(Query.join(table, left, right, operator, alias_name)) end |
#left_join(table, left, right = '', operator = '=', alias_name = '') ⇒ Object
301 302 303 |
# File 'lib/appwrite/query/builder.rb', line 301 def left_join(table, left, right = '', operator = '=', alias_name = '') return push(Query.left_join(table, left, right, operator, alias_name)) end |
#less_than(attribute, value) ⇒ Object
21 22 23 |
# File 'lib/appwrite/query/builder.rb', line 21 def less_than(attribute, value) return push(Query.less_than(attribute, value)) end |
#less_than_equal(attribute, value) ⇒ Object
25 26 27 |
# File 'lib/appwrite/query/builder.rb', line 25 def less_than_equal(attribute, value) return push(Query.less_than_equal(attribute, value)) end |
#limit(limit) ⇒ Object
85 86 87 |
# File 'lib/appwrite/query/builder.rb', line 85 def limit(limit) return push(Query.limit(limit)) end |
#max(attribute, alias_name = '') ⇒ Object
245 246 247 |
# File 'lib/appwrite/query/builder.rb', line 245 def max(attribute, alias_name = '') return push(Query.max(attribute, alias_name)) end |
#min(attribute, alias_name = '') ⇒ Object
241 242 243 |
# File 'lib/appwrite/query/builder.rb', line 241 def min(attribute, alias_name = '') return push(Query.min(attribute, alias_name)) end |
#not_between(attribute, start, ending) ⇒ Object
113 114 115 |
# File 'lib/appwrite/query/builder.rb', line 113 def not_between(attribute, start, ending) return push(Query.not_between(attribute, start, ending)) end |
#not_contains(attribute, value) ⇒ Object
105 106 107 |
# File 'lib/appwrite/query/builder.rb', line 105 def not_contains(attribute, value) return push(Query.not_contains(attribute, value)) end |
#not_covers(attribute, values) ⇒ Object
333 334 335 |
# File 'lib/appwrite/query/builder.rb', line 333 def not_covers(attribute, values) return push(Query.not_covers(attribute, values)) end |
#not_crosses(attribute, values) ⇒ Object
205 206 207 |
# File 'lib/appwrite/query/builder.rb', line 205 def not_crosses(attribute, values) return push(Query.not_crosses(attribute, values)) end |
#not_ends_with(attribute, value) ⇒ Object
121 122 123 |
# File 'lib/appwrite/query/builder.rb', line 121 def not_ends_with(attribute, value) return push(Query.not_ends_with(attribute, value)) end |
#not_equal(attribute, value) ⇒ Object
17 18 19 |
# File 'lib/appwrite/query/builder.rb', line 17 def not_equal(attribute, value) return push(Query.not_equal(attribute, value)) end |
#not_exists(attributes) ⇒ Object
133 134 135 |
# File 'lib/appwrite/query/builder.rb', line 133 def not_exists(attributes) return push(Query.not_exists(attributes)) end |
#not_intersects(attribute, values) ⇒ Object
197 198 199 |
# File 'lib/appwrite/query/builder.rb', line 197 def not_intersects(attribute, values) return push(Query.not_intersects(attribute, values)) end |
#not_overlaps(attribute, values) ⇒ Object
213 214 215 |
# File 'lib/appwrite/query/builder.rb', line 213 def not_overlaps(attribute, values) return push(Query.not_overlaps(attribute, values)) end |
#not_search(attribute, value) ⇒ Object
109 110 111 |
# File 'lib/appwrite/query/builder.rb', line 109 def not_search(attribute, value) return push(Query.not_search(attribute, value)) end |
#not_spatial_equals(attribute, values) ⇒ Object
341 342 343 |
# File 'lib/appwrite/query/builder.rb', line 341 def not_spatial_equals(attribute, values) return push(Query.not_spatial_equals(attribute, values)) end |
#not_starts_with(attribute, value) ⇒ Object
117 118 119 |
# File 'lib/appwrite/query/builder.rb', line 117 def not_starts_with(attribute, value) return push(Query.not_starts_with(attribute, value)) end |
#not_touches(attribute, values) ⇒ Object
221 222 223 |
# File 'lib/appwrite/query/builder.rb', line 221 def not_touches(attribute, values) return push(Query.not_touches(attribute, values)) end |
#offset(offset) ⇒ Object
89 90 91 |
# File 'lib/appwrite/query/builder.rb', line 89 def offset(offset) return push(Query.offset(offset)) end |
#or(queries) ⇒ Object
161 162 163 |
# File 'lib/appwrite/query/builder.rb', line 161 def or(queries) return push(Query.or(queries)) end |
#order_asc(attribute) ⇒ Object
73 74 75 |
# File 'lib/appwrite/query/builder.rb', line 73 def order_asc(attribute) return push(Query.order_asc(attribute)) end |
#order_desc(attribute) ⇒ Object
77 78 79 |
# File 'lib/appwrite/query/builder.rb', line 77 def order_desc(attribute) return push(Query.order_desc(attribute)) end |
#order_random ⇒ Object
81 82 83 |
# File 'lib/appwrite/query/builder.rb', line 81 def order_random() return push(Query.order_random()) end |
#overlaps(attribute, values) ⇒ Object
209 210 211 |
# File 'lib/appwrite/query/builder.rb', line 209 def overlaps(attribute, values) return push(Query.overlaps(attribute, values)) end |
#page(page, per_page = 25) ⇒ Object
345 346 347 |
# File 'lib/appwrite/query/builder.rb', line 345 def page(page, per_page = 25) return push(Query.page(page, per_page)) end |
#regex(attribute, pattern) ⇒ Object
125 126 127 |
# File 'lib/appwrite/query/builder.rb', line 125 def regex(attribute, pattern) return push(Query.regex(attribute, pattern)) end |
#relationship(attribute, queries) ⇒ Object
173 174 175 |
# File 'lib/appwrite/query/builder.rb', line 173 def relationship(attribute, queries) return push(Query.relationship(attribute, queries)) end |
#right_join(table, left, right = '', operator = '=', alias_name = '') ⇒ Object
305 306 307 |
# File 'lib/appwrite/query/builder.rb', line 305 def right_join(table, left, right = '', operator = '=', alias_name = '') return push(Query.right_join(table, left, right, operator, alias_name)) end |
#search(attribute, value) ⇒ Object
37 38 39 |
# File 'lib/appwrite/query/builder.rb', line 37 def search(attribute, value) return push(Query.search(attribute, value)) end |
#select(attributes) ⇒ Object
61 62 63 |
# File 'lib/appwrite/query/builder.rb', line 61 def select(attributes) return push(Query.select(attributes)) end |
#spatial_equals(attribute, values) ⇒ Object
337 338 339 |
# File 'lib/appwrite/query/builder.rb', line 337 def spatial_equals(attribute, values) return push(Query.spatial_equals(attribute, values)) end |
#starts_with(attribute, value) ⇒ Object
53 54 55 |
# File 'lib/appwrite/query/builder.rb', line 53 def starts_with(attribute, value) return push(Query.starts_with(attribute, value)) end |
#stddev(attribute, alias_name = '') ⇒ Object
249 250 251 |
# File 'lib/appwrite/query/builder.rb', line 249 def stddev(attribute, alias_name = '') return push(Query.stddev(attribute, alias_name)) end |
#stddev_pop(attribute, alias_name = '') ⇒ Object
253 254 255 |
# File 'lib/appwrite/query/builder.rb', line 253 def stddev_pop(attribute, alias_name = '') return push(Query.stddev_pop(attribute, alias_name)) end |
#stddev_samp(attribute, alias_name = '') ⇒ Object
257 258 259 |
# File 'lib/appwrite/query/builder.rb', line 257 def stddev_samp(attribute, alias_name = '') return push(Query.stddev_samp(attribute, alias_name)) end |
#sum(attribute, alias_name = '') ⇒ Object
233 234 235 |
# File 'lib/appwrite/query/builder.rb', line 233 def sum(attribute, alias_name = '') return push(Query.sum(attribute, alias_name)) end |
#touches(attribute, values) ⇒ Object
217 218 219 |
# File 'lib/appwrite/query/builder.rb', line 217 def touches(attribute, values) return push(Query.touches(attribute, values)) end |
#updated_after(value) ⇒ Object
153 154 155 |
# File 'lib/appwrite/query/builder.rb', line 153 def updated_after(value) return push(Query.updated_after(value)) end |
#updated_before(value) ⇒ Object
149 150 151 |
# File 'lib/appwrite/query/builder.rb', line 149 def updated_before(value) return push(Query.updated_before(value)) end |
#updated_between(start, ending) ⇒ Object
157 158 159 |
# File 'lib/appwrite/query/builder.rb', line 157 def updated_between(start, ending) return push(Query.updated_between(start, ending)) end |
#var_pop(attribute, alias_name = '') ⇒ Object
265 266 267 |
# File 'lib/appwrite/query/builder.rb', line 265 def var_pop(attribute, alias_name = '') return push(Query.var_pop(attribute, alias_name)) end |
#var_samp(attribute, alias_name = '') ⇒ Object
269 270 271 |
# File 'lib/appwrite/query/builder.rb', line 269 def var_samp(attribute, alias_name = '') return push(Query.var_samp(attribute, alias_name)) end |
#variance(attribute, alias_name = '') ⇒ Object
261 262 263 |
# File 'lib/appwrite/query/builder.rb', line 261 def variance(attribute, alias_name = '') return push(Query.variance(attribute, alias_name)) end |
#vector_cosine(attribute, vector) ⇒ Object
321 322 323 |
# File 'lib/appwrite/query/builder.rb', line 321 def vector_cosine(attribute, vector) return push(Query.vector_cosine(attribute, vector)) end |
#vector_dot(attribute, vector) ⇒ Object
317 318 319 |
# File 'lib/appwrite/query/builder.rb', line 317 def vector_dot(attribute, vector) return push(Query.vector_dot(attribute, vector)) end |
#vector_euclidean(attribute, vector) ⇒ Object
325 326 327 |
# File 'lib/appwrite/query/builder.rb', line 325 def vector_euclidean(attribute, vector) return push(Query.vector_euclidean(attribute, vector)) end |