rethinkdb 1.2.6.1 → 1.4.0.0
Sign up to get free protection for your applications and to get access to all the features.
- data/lib/exc.rb +30 -0
- data/lib/func.rb +156 -0
- data/lib/net.rb +137 -177
- data/lib/ql2.pb.rb +615 -0
- data/lib/rethinkdb.rb +70 -9
- data/lib/rpp.rb +191 -0
- data/lib/shim.rb +101 -0
- metadata +13 -21
- data/lib/base_classes.rb +0 -39
- data/lib/bt.rb +0 -148
- data/lib/data_collectors.rb +0 -35
- data/lib/jsons.rb +0 -140
- data/lib/protob_compiler.rb +0 -137
- data/lib/query.rb +0 -111
- data/lib/query_language.pb.rb +0 -687
- data/lib/rql.rb +0 -472
- data/lib/sequence.rb +0 -350
- data/lib/streams.rb +0 -101
- data/lib/tables.rb +0 -123
- data/lib/utils.rb +0 -118
- data/lib/writes.rb +0 -24
data/lib/query.rb
DELETED
@@ -1,111 +0,0 @@
|
|
1
|
-
# Copyright 2010-2012 RethinkDB, all rights reserved.
|
2
|
-
module RethinkDB
|
3
|
-
# An RQL query that can be sent to the RethinkDB cluster. This class contains
|
4
|
-
# only functions that work for any type of query. Queries are either
|
5
|
-
# constructed by methods in the RQL module, or by invoking the instance
|
6
|
-
# methods of a query on other queries.
|
7
|
-
class RQL_Query
|
8
|
-
def boolop? # :nodoc:
|
9
|
-
false
|
10
|
-
end
|
11
|
-
# Run the invoking query using the most recently opened connection. See
|
12
|
-
# Connection#run for more details.
|
13
|
-
def run(*args)
|
14
|
-
Connection.last.send(:run, self, *args)
|
15
|
-
end
|
16
|
-
|
17
|
-
def set_body(val, context=nil) # :nodoc:
|
18
|
-
@context = context || caller
|
19
|
-
@body = val
|
20
|
-
end
|
21
|
-
|
22
|
-
def initialize(init_body, context=nil) # :nodoc:
|
23
|
-
set_body(init_body, context)
|
24
|
-
end
|
25
|
-
|
26
|
-
def ==(rhs) # :nodoc:
|
27
|
-
raise ArgumentError,"
|
28
|
-
Cannot use inline ==/!= with RQL queries, use .eq() instead if
|
29
|
-
you want a query that does equality comparison.
|
30
|
-
|
31
|
-
If you need to see whether two queries are the same, compare
|
32
|
-
their S-expression representations like: `query1.sexp ==
|
33
|
-
query2.sexp`."
|
34
|
-
end
|
35
|
-
|
36
|
-
# Return the S-expression representation of a query. Used for
|
37
|
-
# equality comparison and advanced debugging.
|
38
|
-
def sexp
|
39
|
-
S.clean_lst @body
|
40
|
-
end
|
41
|
-
attr_accessor :body, :marked, :context
|
42
|
-
|
43
|
-
# Compile into either a protobuf class or a query.
|
44
|
-
def as _class # :nodoc:
|
45
|
-
RQL_Protob.comp(_class, sexp)
|
46
|
-
end
|
47
|
-
def query(map={S.conn_outdated => false}) # :nodoc:
|
48
|
-
RQL_Protob.query(S.replace(sexp, map))
|
49
|
-
end
|
50
|
-
|
51
|
-
def print_backtrace(bt) # :nodoc:
|
52
|
-
#PP.pp [bt, bt.map{|x| BT.expand x}.flatten, sexp]
|
53
|
-
begin
|
54
|
-
BT.with_marked_error(self, bt) {
|
55
|
-
query = "Query: #{inspect}\n #{BT.with_highlight {inspect}}"
|
56
|
-
line = "Line: #{BT.line || "Unknown"}"
|
57
|
-
line + "\n" + query
|
58
|
-
}
|
59
|
-
rescue Exception => e
|
60
|
-
PP.pp [bt, e] if $DEBUG
|
61
|
-
"<Internal error in query pretty printer.>"
|
62
|
-
end
|
63
|
-
end
|
64
|
-
|
65
|
-
def pprint # :nodoc:
|
66
|
-
return @body.inspect if @body.class != Array
|
67
|
-
return "" if @body == []
|
68
|
-
case @body[0]
|
69
|
-
when :call then
|
70
|
-
if @body[2].length == 1
|
71
|
-
@body[2][0].inspect + "." + RQL_Query.new(@body[1],@context).inspect
|
72
|
-
else
|
73
|
-
func = @body[1][0].to_s
|
74
|
-
func_args = @body[1][1..-1].map{|x| x.inspect}
|
75
|
-
call_args = @body[2].map{|x| x.inspect}
|
76
|
-
func + "(" + (func_args + call_args).join(", ") + ")"
|
77
|
-
end
|
78
|
-
else
|
79
|
-
func = @body[0].to_s
|
80
|
-
func_args = @body[1..-1].map{|x| x.inspect}
|
81
|
-
func + "(" + func_args.join(", ") + ")"
|
82
|
-
end
|
83
|
-
end
|
84
|
-
|
85
|
-
def real_inspect(args) # :nodoc:
|
86
|
-
str = args[:str] || pprint
|
87
|
-
(BT.highlight and @marked) ? "\000"*str.length : str
|
88
|
-
end
|
89
|
-
|
90
|
-
def inspect # :nodoc:
|
91
|
-
real_inspect({})
|
92
|
-
end
|
93
|
-
|
94
|
-
# Dereference aliases (see utils.rb) and possibly dispatch to RQL
|
95
|
-
# (because the caller may be trying to use the more convenient
|
96
|
-
# inline version of an RQL function).
|
97
|
-
def method_missing(m, *args, &block) # :nodoc:
|
98
|
-
if (m2 = C.method_aliases[m]); then return self.send(m2, *args, &block); end
|
99
|
-
if RQL.methods.map{|x| x.to_sym}.include?(m)
|
100
|
-
return RQL.send(m, *[self, *args], &block)
|
101
|
-
end
|
102
|
-
super(m, *args, &block)
|
103
|
-
end
|
104
|
-
end
|
105
|
-
end
|
106
|
-
|
107
|
-
load 'tables.rb'
|
108
|
-
load 'sequence.rb'
|
109
|
-
load 'streams.rb'
|
110
|
-
load 'jsons.rb'
|
111
|
-
load 'writes.rb'
|
data/lib/query_language.pb.rb
DELETED
@@ -1,687 +0,0 @@
|
|
1
|
-
### Generated by rprotoc. DO NOT EDIT!
|
2
|
-
### <proto file: ../../src/rdb_protocol/query_language.proto>
|
3
|
-
# message TableRef {
|
4
|
-
# required string db_name = 1;
|
5
|
-
# required string table_name = 2;
|
6
|
-
# optional bool use_outdated = 3 [default = false]; //Use and outdated version of this table
|
7
|
-
# };
|
8
|
-
#
|
9
|
-
# message VarTermTuple {
|
10
|
-
# required string var = 1;
|
11
|
-
# required Term term = 2;
|
12
|
-
# };
|
13
|
-
#
|
14
|
-
# message Term {
|
15
|
-
# enum TermType {
|
16
|
-
# JSON_NULL = 0; //can't use just "NULL" here we get in trouble
|
17
|
-
# VAR = 1;
|
18
|
-
# LET = 2;
|
19
|
-
# CALL = 3;
|
20
|
-
# IF = 4;
|
21
|
-
# ERROR = 5;
|
22
|
-
# NUMBER = 6;
|
23
|
-
# STRING = 7;
|
24
|
-
# JSON = 8;
|
25
|
-
# BOOL = 9;
|
26
|
-
# ARRAY = 10;
|
27
|
-
# OBJECT = 11;
|
28
|
-
# GETBYKEY = 12;
|
29
|
-
# TABLE = 13;
|
30
|
-
# JAVASCRIPT = 14;
|
31
|
-
# IMPLICIT_VAR = 15;
|
32
|
-
# };
|
33
|
-
#
|
34
|
-
# required TermType type = 1;
|
35
|
-
#
|
36
|
-
# optional string var = 2;
|
37
|
-
#
|
38
|
-
# message Let {
|
39
|
-
# repeated VarTermTuple binds = 1;
|
40
|
-
# required Term expr = 2;
|
41
|
-
# };
|
42
|
-
#
|
43
|
-
# optional Let let = 3;
|
44
|
-
#
|
45
|
-
# message Call {
|
46
|
-
# required Builtin builtin = 1;
|
47
|
-
# repeated Term args = 2;
|
48
|
-
# };
|
49
|
-
#
|
50
|
-
# optional Call call = 4;
|
51
|
-
#
|
52
|
-
# message If {
|
53
|
-
# required Term test = 1;
|
54
|
-
# required Term true_branch = 2;
|
55
|
-
# required Term false_branch = 3;
|
56
|
-
# };
|
57
|
-
#
|
58
|
-
# optional If if_ = 5;
|
59
|
-
#
|
60
|
-
# optional string error = 6;
|
61
|
-
#
|
62
|
-
# optional double number = 7;
|
63
|
-
#
|
64
|
-
# optional string valuestring = 8;
|
65
|
-
#
|
66
|
-
# optional string jsonstring = 9;
|
67
|
-
#
|
68
|
-
# optional bool valuebool = 10;
|
69
|
-
#
|
70
|
-
# repeated Term array = 11;
|
71
|
-
#
|
72
|
-
# repeated VarTermTuple object = 12;
|
73
|
-
# message GetByKey {
|
74
|
-
# required TableRef table_ref = 1;
|
75
|
-
# required string attrname = 2;
|
76
|
-
# required Term key = 3;
|
77
|
-
# };
|
78
|
-
#
|
79
|
-
# optional GetByKey get_by_key = 14;
|
80
|
-
#
|
81
|
-
# message Table {
|
82
|
-
# required TableRef table_ref = 1;
|
83
|
-
# };
|
84
|
-
#
|
85
|
-
# optional Table table = 15;
|
86
|
-
#
|
87
|
-
# optional string javascript = 16;
|
88
|
-
#
|
89
|
-
# // reserved for RethinkDB internal use.
|
90
|
-
# extensions 1000 to 1099;
|
91
|
-
# };
|
92
|
-
#
|
93
|
-
# message Builtin {
|
94
|
-
# enum BuiltinType {
|
95
|
-
# NOT = 1;
|
96
|
-
# GETATTR = 2;
|
97
|
-
# IMPLICIT_GETATTR = 3;
|
98
|
-
# HASATTR = 4;
|
99
|
-
# IMPLICIT_HASATTR = 5;
|
100
|
-
# PICKATTRS = 6;
|
101
|
-
# IMPLICIT_PICKATTRS = 7;
|
102
|
-
# MAPMERGE = 8;
|
103
|
-
# ARRAYAPPEND = 9;
|
104
|
-
# SLICE = 11; // slice(thing_to_slice, None/left extent, None/right extent)
|
105
|
-
# ADD = 14;
|
106
|
-
# SUBTRACT = 15;
|
107
|
-
# MULTIPLY = 16;
|
108
|
-
# DIVIDE = 17;
|
109
|
-
# MODULO = 18;
|
110
|
-
# COMPARE = 19;
|
111
|
-
# FILTER = 20;
|
112
|
-
# MAP = 21; // operates over streams
|
113
|
-
# CONCATMAP = 22;
|
114
|
-
# ORDERBY = 23;
|
115
|
-
# DISTINCT = 24;
|
116
|
-
# LENGTH = 26;
|
117
|
-
# UNION = 27;
|
118
|
-
# NTH = 28;
|
119
|
-
# STREAMTOARRAY = 29;
|
120
|
-
# ARRAYTOSTREAM = 30;
|
121
|
-
# REDUCE = 31;
|
122
|
-
# GROUPEDMAPREDUCE = 32;
|
123
|
-
# ANY = 35;
|
124
|
-
# ALL = 36;
|
125
|
-
# RANGE = 37;
|
126
|
-
# IMPLICIT_WITHOUT = 38;
|
127
|
-
# WITHOUT = 39;
|
128
|
-
# };
|
129
|
-
#
|
130
|
-
# enum Comparison {
|
131
|
-
# EQ = 1;
|
132
|
-
# NE = 2;
|
133
|
-
# LT = 3;
|
134
|
-
# LE = 4;
|
135
|
-
# GT = 5;
|
136
|
-
# GE = 6;
|
137
|
-
# };
|
138
|
-
#
|
139
|
-
# required BuiltinType type = 1;
|
140
|
-
#
|
141
|
-
# optional string attr = 2; //used if type is GETATTR of HASATTR
|
142
|
-
#
|
143
|
-
# repeated string attrs = 3; //used if type is PICKATTRS or WITHOUT
|
144
|
-
#
|
145
|
-
# optional Comparison comparison = 4;
|
146
|
-
#
|
147
|
-
# message Filter {
|
148
|
-
# required Predicate predicate = 1;
|
149
|
-
# };
|
150
|
-
#
|
151
|
-
# optional Filter filter = 5;
|
152
|
-
#
|
153
|
-
# message Map {
|
154
|
-
# required Mapping mapping = 1;
|
155
|
-
# };
|
156
|
-
#
|
157
|
-
# optional Map map = 6;
|
158
|
-
#
|
159
|
-
# message ConcatMap {
|
160
|
-
# required Mapping mapping = 1;
|
161
|
-
# };
|
162
|
-
#
|
163
|
-
# optional ConcatMap concat_map = 7;
|
164
|
-
#
|
165
|
-
# message OrderBy {
|
166
|
-
# required string attr = 1;
|
167
|
-
# optional bool ascending = 2 [default = true];
|
168
|
-
# };
|
169
|
-
#
|
170
|
-
# repeated OrderBy order_by = 8;
|
171
|
-
#
|
172
|
-
# optional Reduction reduce = 9;
|
173
|
-
#
|
174
|
-
# message GroupedMapReduce {
|
175
|
-
# required Mapping group_mapping = 1;
|
176
|
-
# required Mapping value_mapping = 2;
|
177
|
-
# required Reduction reduction = 3;
|
178
|
-
# };
|
179
|
-
#
|
180
|
-
# optional GroupedMapReduce grouped_map_reduce = 10;
|
181
|
-
#
|
182
|
-
# message Range {
|
183
|
-
# required string attrname = 1;
|
184
|
-
# optional Term lowerbound = 2;
|
185
|
-
# optional Term upperbound = 3;
|
186
|
-
# };
|
187
|
-
#
|
188
|
-
# optional Range range = 11;
|
189
|
-
# };
|
190
|
-
#
|
191
|
-
# message Reduction {
|
192
|
-
# required Term base = 1;
|
193
|
-
# required string var1 = 2;
|
194
|
-
# required string var2 = 3;
|
195
|
-
# required Term body = 4;
|
196
|
-
# };
|
197
|
-
#
|
198
|
-
# message Mapping {
|
199
|
-
# required string arg = 1;
|
200
|
-
# required Term body = 2;
|
201
|
-
# extensions 1000 to 1099;
|
202
|
-
# };
|
203
|
-
#
|
204
|
-
# message Predicate {
|
205
|
-
# required string arg = 1;
|
206
|
-
# required Term body = 2;
|
207
|
-
# };
|
208
|
-
#
|
209
|
-
# message ReadQuery {
|
210
|
-
# required Term term = 1;
|
211
|
-
# optional int64 max_chunk_size = 2; //may be 0 for unlimited
|
212
|
-
# optional int64 max_age = 3;
|
213
|
-
#
|
214
|
-
# // reserved for RethinkDB internal use.
|
215
|
-
# extensions 1000 to 1099;
|
216
|
-
# };
|
217
|
-
#
|
218
|
-
# message WriteQuery {
|
219
|
-
# enum WriteQueryType {
|
220
|
-
# UPDATE = 1;
|
221
|
-
# DELETE = 2;
|
222
|
-
# MUTATE = 3;
|
223
|
-
# INSERT = 4;
|
224
|
-
# FOREACH = 6;
|
225
|
-
# POINTUPDATE = 7;
|
226
|
-
# POINTDELETE = 8;
|
227
|
-
# POINTMUTATE = 9;
|
228
|
-
# };
|
229
|
-
#
|
230
|
-
# required WriteQueryType type = 1;
|
231
|
-
# optional bool atomic = 11 [default = true];
|
232
|
-
#
|
233
|
-
# message Update {
|
234
|
-
# required Term view = 1;
|
235
|
-
# required Mapping mapping = 2;
|
236
|
-
# };
|
237
|
-
#
|
238
|
-
# optional Update update = 2;
|
239
|
-
#
|
240
|
-
# message Delete {
|
241
|
-
# required Term view = 1;
|
242
|
-
# };
|
243
|
-
#
|
244
|
-
# optional Delete delete = 3;
|
245
|
-
#
|
246
|
-
# message Mutate {
|
247
|
-
# required Term view = 1;
|
248
|
-
# required Mapping mapping = 2;
|
249
|
-
# };
|
250
|
-
#
|
251
|
-
# optional Mutate mutate = 4;
|
252
|
-
#
|
253
|
-
# message Insert {
|
254
|
-
# required TableRef table_ref = 1;
|
255
|
-
# repeated Term terms = 2;
|
256
|
-
# optional bool overwrite = 3 [default = false];
|
257
|
-
# };
|
258
|
-
#
|
259
|
-
# optional Insert insert = 5;
|
260
|
-
#
|
261
|
-
# message ForEach {
|
262
|
-
# required Term stream = 1;
|
263
|
-
# required string var = 2;
|
264
|
-
# repeated WriteQuery queries = 3;
|
265
|
-
# };
|
266
|
-
#
|
267
|
-
# optional ForEach for_each = 7;
|
268
|
-
#
|
269
|
-
# message PointUpdate {
|
270
|
-
# required TableRef table_ref = 1;
|
271
|
-
# required string attrname = 2;
|
272
|
-
# required Term key = 3;
|
273
|
-
# required Mapping mapping = 4;
|
274
|
-
# };
|
275
|
-
#
|
276
|
-
# optional PointUpdate point_update = 8;
|
277
|
-
#
|
278
|
-
# message PointDelete {
|
279
|
-
# required TableRef table_ref = 1;
|
280
|
-
# required string attrname = 2;
|
281
|
-
# required Term key = 3;
|
282
|
-
# };
|
283
|
-
#
|
284
|
-
# optional PointDelete point_delete = 9;
|
285
|
-
#
|
286
|
-
# message PointMutate {
|
287
|
-
# required TableRef table_ref = 1;
|
288
|
-
# required string attrname = 2;
|
289
|
-
# required Term key = 3;
|
290
|
-
# required Mapping mapping = 4;
|
291
|
-
# };
|
292
|
-
#
|
293
|
-
# optional PointMutate point_mutate = 10;
|
294
|
-
# };
|
295
|
-
#
|
296
|
-
# message MetaQuery {
|
297
|
-
# enum MetaQueryType {
|
298
|
-
# CREATE_DB = 1; //db_name
|
299
|
-
# DROP_DB = 2; //db_name
|
300
|
-
# LIST_DBS = 3;
|
301
|
-
#
|
302
|
-
# CREATE_TABLE = 4;
|
303
|
-
# DROP_TABLE = 5;
|
304
|
-
# LIST_TABLES = 6; //db_name
|
305
|
-
# };
|
306
|
-
# required MetaQueryType type = 1;
|
307
|
-
# optional string db_name = 2;
|
308
|
-
#
|
309
|
-
# message CreateTable {
|
310
|
-
# optional string datacenter = 1;
|
311
|
-
# required TableRef table_ref = 3;
|
312
|
-
# optional string primary_key = 4 [default = "id"];
|
313
|
-
# optional int64 cache_size = 5 [default = 1073741824]; //notice that's a gigabyte right there.
|
314
|
-
# }
|
315
|
-
# optional CreateTable create_table = 3;
|
316
|
-
#
|
317
|
-
# optional TableRef drop_table = 4;
|
318
|
-
# };
|
319
|
-
#
|
320
|
-
# message Query {
|
321
|
-
# enum QueryType {
|
322
|
-
# READ = 1; //Begin reading from a stream (and possibly finish if it's short)
|
323
|
-
# WRITE = 2; //Write to a table (currently does not create a stream)
|
324
|
-
# CONTINUE = 3; //Continue reading from a stream
|
325
|
-
# STOP = 4; //Stop reading from a stream and release its resources
|
326
|
-
# META = 5; //Meta operations that create, drop, or list databases/tables
|
327
|
-
# }
|
328
|
-
#
|
329
|
-
# required QueryType type = 1;
|
330
|
-
#
|
331
|
-
# required int64 token = 2;
|
332
|
-
#
|
333
|
-
# optional ReadQuery read_query = 3;
|
334
|
-
# optional WriteQuery write_query = 4;
|
335
|
-
# optional MetaQuery meta_query = 5;
|
336
|
-
# }
|
337
|
-
#
|
338
|
-
# message Response {
|
339
|
-
# enum StatusCode {
|
340
|
-
# SUCCESS_EMPTY = 0;
|
341
|
-
# SUCCESS_JSON = 1;
|
342
|
-
# SUCCESS_PARTIAL = 2; //need to send CONTINUE repeatedly until SUCCESS_STREAM
|
343
|
-
# SUCCESS_STREAM = 3;
|
344
|
-
#
|
345
|
-
# BROKEN_CLIENT = 101; // Means the client is misbehaving, not the user
|
346
|
-
# BAD_QUERY = 102;
|
347
|
-
# RUNTIME_ERROR = 103;
|
348
|
-
# }
|
349
|
-
# required StatusCode status_code = 1;
|
350
|
-
#
|
351
|
-
# required int64 token = 2;
|
352
|
-
#
|
353
|
-
# repeated string response = 3;
|
354
|
-
#
|
355
|
-
# optional string error_message = 4;
|
356
|
-
#
|
357
|
-
# message Backtrace {
|
358
|
-
# repeated string frame = 1;
|
359
|
-
# };
|
360
|
-
#
|
361
|
-
# optional Backtrace backtrace = 5;
|
362
|
-
# }
|
363
|
-
|
364
|
-
require 'protobuf/message/message'
|
365
|
-
require 'protobuf/message/enum'
|
366
|
-
require 'protobuf/message/service'
|
367
|
-
require 'protobuf/message/extend'
|
368
|
-
|
369
|
-
class TableRef < ::Protobuf::Message
|
370
|
-
defined_in __FILE__
|
371
|
-
required :string, :db_name, 1
|
372
|
-
required :string, :table_name, 2
|
373
|
-
optional :bool, :use_outdated, 3, :default => false
|
374
|
-
end
|
375
|
-
class VarTermTuple < ::Protobuf::Message
|
376
|
-
defined_in __FILE__
|
377
|
-
required :string, :var, 1
|
378
|
-
required :Term, :term, 2
|
379
|
-
end
|
380
|
-
class Term < ::Protobuf::Message
|
381
|
-
defined_in __FILE__
|
382
|
-
class TermType < ::Protobuf::Enum
|
383
|
-
defined_in __FILE__
|
384
|
-
JSON_NULL = value(:JSON_NULL, 0)
|
385
|
-
VAR = value(:VAR, 1)
|
386
|
-
LET = value(:LET, 2)
|
387
|
-
CALL = value(:CALL, 3)
|
388
|
-
IF = value(:IF, 4)
|
389
|
-
ERROR = value(:ERROR, 5)
|
390
|
-
NUMBER = value(:NUMBER, 6)
|
391
|
-
STRING = value(:STRING, 7)
|
392
|
-
JSON = value(:JSON, 8)
|
393
|
-
BOOL = value(:BOOL, 9)
|
394
|
-
ARRAY = value(:ARRAY, 10)
|
395
|
-
OBJECT = value(:OBJECT, 11)
|
396
|
-
GETBYKEY = value(:GETBYKEY, 12)
|
397
|
-
TABLE = value(:TABLE, 13)
|
398
|
-
JAVASCRIPT = value(:JAVASCRIPT, 14)
|
399
|
-
IMPLICIT_VAR = value(:IMPLICIT_VAR, 15)
|
400
|
-
end
|
401
|
-
required :TermType, :type, 1
|
402
|
-
optional :string, :var, 2
|
403
|
-
class Let < ::Protobuf::Message
|
404
|
-
defined_in __FILE__
|
405
|
-
repeated :VarTermTuple, :binds, 1
|
406
|
-
required :Term, :expr, 2
|
407
|
-
end
|
408
|
-
optional :Let, :let, 3
|
409
|
-
class Call < ::Protobuf::Message
|
410
|
-
defined_in __FILE__
|
411
|
-
required :Builtin, :builtin, 1
|
412
|
-
repeated :Term, :args, 2
|
413
|
-
end
|
414
|
-
optional :Call, :call, 4
|
415
|
-
class If < ::Protobuf::Message
|
416
|
-
defined_in __FILE__
|
417
|
-
required :Term, :test, 1
|
418
|
-
required :Term, :true_branch, 2
|
419
|
-
required :Term, :false_branch, 3
|
420
|
-
end
|
421
|
-
optional :If, :if_, 5
|
422
|
-
optional :string, :error, 6
|
423
|
-
optional :double, :number, 7
|
424
|
-
optional :string, :valuestring, 8
|
425
|
-
optional :string, :jsonstring, 9
|
426
|
-
optional :bool, :valuebool, 10
|
427
|
-
repeated :Term, :array, 11
|
428
|
-
repeated :VarTermTuple, :object, 12
|
429
|
-
class GetByKey < ::Protobuf::Message
|
430
|
-
defined_in __FILE__
|
431
|
-
required :TableRef, :table_ref, 1
|
432
|
-
required :string, :attrname, 2
|
433
|
-
required :Term, :key, 3
|
434
|
-
end
|
435
|
-
optional :GetByKey, :get_by_key, 14
|
436
|
-
class Table < ::Protobuf::Message
|
437
|
-
defined_in __FILE__
|
438
|
-
required :TableRef, :table_ref, 1
|
439
|
-
end
|
440
|
-
optional :Table, :table, 15
|
441
|
-
optional :string, :javascript, 16
|
442
|
-
extensions 1000..1099
|
443
|
-
end
|
444
|
-
class Builtin < ::Protobuf::Message
|
445
|
-
defined_in __FILE__
|
446
|
-
class BuiltinType < ::Protobuf::Enum
|
447
|
-
defined_in __FILE__
|
448
|
-
NOT = value(:NOT, 1)
|
449
|
-
GETATTR = value(:GETATTR, 2)
|
450
|
-
IMPLICIT_GETATTR = value(:IMPLICIT_GETATTR, 3)
|
451
|
-
HASATTR = value(:HASATTR, 4)
|
452
|
-
IMPLICIT_HASATTR = value(:IMPLICIT_HASATTR, 5)
|
453
|
-
PICKATTRS = value(:PICKATTRS, 6)
|
454
|
-
IMPLICIT_PICKATTRS = value(:IMPLICIT_PICKATTRS, 7)
|
455
|
-
MAPMERGE = value(:MAPMERGE, 8)
|
456
|
-
ARRAYAPPEND = value(:ARRAYAPPEND, 9)
|
457
|
-
SLICE = value(:SLICE, 11)
|
458
|
-
ADD = value(:ADD, 14)
|
459
|
-
SUBTRACT = value(:SUBTRACT, 15)
|
460
|
-
MULTIPLY = value(:MULTIPLY, 16)
|
461
|
-
DIVIDE = value(:DIVIDE, 17)
|
462
|
-
MODULO = value(:MODULO, 18)
|
463
|
-
COMPARE = value(:COMPARE, 19)
|
464
|
-
FILTER = value(:FILTER, 20)
|
465
|
-
MAP = value(:MAP, 21)
|
466
|
-
CONCATMAP = value(:CONCATMAP, 22)
|
467
|
-
ORDERBY = value(:ORDERBY, 23)
|
468
|
-
DISTINCT = value(:DISTINCT, 24)
|
469
|
-
LENGTH = value(:LENGTH, 26)
|
470
|
-
UNION = value(:UNION, 27)
|
471
|
-
NTH = value(:NTH, 28)
|
472
|
-
STREAMTOARRAY = value(:STREAMTOARRAY, 29)
|
473
|
-
ARRAYTOSTREAM = value(:ARRAYTOSTREAM, 30)
|
474
|
-
REDUCE = value(:REDUCE, 31)
|
475
|
-
GROUPEDMAPREDUCE = value(:GROUPEDMAPREDUCE, 32)
|
476
|
-
ANY = value(:ANY, 35)
|
477
|
-
ALL = value(:ALL, 36)
|
478
|
-
RANGE = value(:RANGE, 37)
|
479
|
-
IMPLICIT_WITHOUT = value(:IMPLICIT_WITHOUT, 38)
|
480
|
-
WITHOUT = value(:WITHOUT, 39)
|
481
|
-
end
|
482
|
-
class Comparison < ::Protobuf::Enum
|
483
|
-
defined_in __FILE__
|
484
|
-
EQ = value(:EQ, 1)
|
485
|
-
NE = value(:NE, 2)
|
486
|
-
LT = value(:LT, 3)
|
487
|
-
LE = value(:LE, 4)
|
488
|
-
GT = value(:GT, 5)
|
489
|
-
GE = value(:GE, 6)
|
490
|
-
end
|
491
|
-
required :BuiltinType, :type, 1
|
492
|
-
optional :string, :attr, 2
|
493
|
-
repeated :string, :attrs, 3
|
494
|
-
optional :Comparison, :comparison, 4
|
495
|
-
class Filter < ::Protobuf::Message
|
496
|
-
defined_in __FILE__
|
497
|
-
required :Predicate, :predicate, 1
|
498
|
-
end
|
499
|
-
optional :Filter, :filter, 5
|
500
|
-
class Map < ::Protobuf::Message
|
501
|
-
defined_in __FILE__
|
502
|
-
required :Mapping, :mapping, 1
|
503
|
-
end
|
504
|
-
optional :Map, :map, 6
|
505
|
-
class ConcatMap < ::Protobuf::Message
|
506
|
-
defined_in __FILE__
|
507
|
-
required :Mapping, :mapping, 1
|
508
|
-
end
|
509
|
-
optional :ConcatMap, :concat_map, 7
|
510
|
-
class OrderBy < ::Protobuf::Message
|
511
|
-
defined_in __FILE__
|
512
|
-
required :string, :attr, 1
|
513
|
-
optional :bool, :ascending, 2, :default => true
|
514
|
-
end
|
515
|
-
repeated :OrderBy, :order_by, 8
|
516
|
-
optional :Reduction, :reduce, 9
|
517
|
-
class GroupedMapReduce < ::Protobuf::Message
|
518
|
-
defined_in __FILE__
|
519
|
-
required :Mapping, :group_mapping, 1
|
520
|
-
required :Mapping, :value_mapping, 2
|
521
|
-
required :Reduction, :reduction, 3
|
522
|
-
end
|
523
|
-
optional :GroupedMapReduce, :grouped_map_reduce, 10
|
524
|
-
class Range < ::Protobuf::Message
|
525
|
-
defined_in __FILE__
|
526
|
-
required :string, :attrname, 1
|
527
|
-
optional :Term, :lowerbound, 2
|
528
|
-
optional :Term, :upperbound, 3
|
529
|
-
end
|
530
|
-
optional :Range, :range, 11
|
531
|
-
end
|
532
|
-
class Reduction < ::Protobuf::Message
|
533
|
-
defined_in __FILE__
|
534
|
-
required :Term, :base, 1
|
535
|
-
required :string, :var1, 2
|
536
|
-
required :string, :var2, 3
|
537
|
-
required :Term, :body, 4
|
538
|
-
end
|
539
|
-
class Mapping < ::Protobuf::Message
|
540
|
-
defined_in __FILE__
|
541
|
-
required :string, :arg, 1
|
542
|
-
required :Term, :body, 2
|
543
|
-
extensions 1000..1099
|
544
|
-
end
|
545
|
-
class Predicate < ::Protobuf::Message
|
546
|
-
defined_in __FILE__
|
547
|
-
required :string, :arg, 1
|
548
|
-
required :Term, :body, 2
|
549
|
-
end
|
550
|
-
class ReadQuery < ::Protobuf::Message
|
551
|
-
defined_in __FILE__
|
552
|
-
required :Term, :term, 1
|
553
|
-
optional :int64, :max_chunk_size, 2
|
554
|
-
optional :int64, :max_age, 3
|
555
|
-
extensions 1000..1099
|
556
|
-
end
|
557
|
-
class WriteQuery < ::Protobuf::Message
|
558
|
-
defined_in __FILE__
|
559
|
-
class WriteQueryType < ::Protobuf::Enum
|
560
|
-
defined_in __FILE__
|
561
|
-
UPDATE = value(:UPDATE, 1)
|
562
|
-
DELETE = value(:DELETE, 2)
|
563
|
-
MUTATE = value(:MUTATE, 3)
|
564
|
-
INSERT = value(:INSERT, 4)
|
565
|
-
FOREACH = value(:FOREACH, 6)
|
566
|
-
POINTUPDATE = value(:POINTUPDATE, 7)
|
567
|
-
POINTDELETE = value(:POINTDELETE, 8)
|
568
|
-
POINTMUTATE = value(:POINTMUTATE, 9)
|
569
|
-
end
|
570
|
-
required :WriteQueryType, :type, 1
|
571
|
-
optional :bool, :atomic, 11, :default => true
|
572
|
-
class Update < ::Protobuf::Message
|
573
|
-
defined_in __FILE__
|
574
|
-
required :Term, :view, 1
|
575
|
-
required :Mapping, :mapping, 2
|
576
|
-
end
|
577
|
-
optional :Update, :update, 2
|
578
|
-
class Delete < ::Protobuf::Message
|
579
|
-
defined_in __FILE__
|
580
|
-
required :Term, :view, 1
|
581
|
-
end
|
582
|
-
optional :Delete, :delete, 3
|
583
|
-
class Mutate < ::Protobuf::Message
|
584
|
-
defined_in __FILE__
|
585
|
-
required :Term, :view, 1
|
586
|
-
required :Mapping, :mapping, 2
|
587
|
-
end
|
588
|
-
optional :Mutate, :mutate, 4
|
589
|
-
class Insert < ::Protobuf::Message
|
590
|
-
defined_in __FILE__
|
591
|
-
required :TableRef, :table_ref, 1
|
592
|
-
repeated :Term, :terms, 2
|
593
|
-
optional :bool, :overwrite, 3, :default => false
|
594
|
-
end
|
595
|
-
optional :Insert, :insert, 5
|
596
|
-
class ForEach < ::Protobuf::Message
|
597
|
-
defined_in __FILE__
|
598
|
-
required :Term, :stream, 1
|
599
|
-
required :string, :var, 2
|
600
|
-
repeated :WriteQuery, :queries, 3
|
601
|
-
end
|
602
|
-
optional :ForEach, :for_each, 7
|
603
|
-
class PointUpdate < ::Protobuf::Message
|
604
|
-
defined_in __FILE__
|
605
|
-
required :TableRef, :table_ref, 1
|
606
|
-
required :string, :attrname, 2
|
607
|
-
required :Term, :key, 3
|
608
|
-
required :Mapping, :mapping, 4
|
609
|
-
end
|
610
|
-
optional :PointUpdate, :point_update, 8
|
611
|
-
class PointDelete < ::Protobuf::Message
|
612
|
-
defined_in __FILE__
|
613
|
-
required :TableRef, :table_ref, 1
|
614
|
-
required :string, :attrname, 2
|
615
|
-
required :Term, :key, 3
|
616
|
-
end
|
617
|
-
optional :PointDelete, :point_delete, 9
|
618
|
-
class PointMutate < ::Protobuf::Message
|
619
|
-
defined_in __FILE__
|
620
|
-
required :TableRef, :table_ref, 1
|
621
|
-
required :string, :attrname, 2
|
622
|
-
required :Term, :key, 3
|
623
|
-
required :Mapping, :mapping, 4
|
624
|
-
end
|
625
|
-
optional :PointMutate, :point_mutate, 10
|
626
|
-
end
|
627
|
-
class MetaQuery < ::Protobuf::Message
|
628
|
-
defined_in __FILE__
|
629
|
-
class MetaQueryType < ::Protobuf::Enum
|
630
|
-
defined_in __FILE__
|
631
|
-
CREATE_DB = value(:CREATE_DB, 1)
|
632
|
-
DROP_DB = value(:DROP_DB, 2)
|
633
|
-
LIST_DBS = value(:LIST_DBS, 3)
|
634
|
-
CREATE_TABLE = value(:CREATE_TABLE, 4)
|
635
|
-
DROP_TABLE = value(:DROP_TABLE, 5)
|
636
|
-
LIST_TABLES = value(:LIST_TABLES, 6)
|
637
|
-
end
|
638
|
-
required :MetaQueryType, :type, 1
|
639
|
-
optional :string, :db_name, 2
|
640
|
-
class CreateTable < ::Protobuf::Message
|
641
|
-
defined_in __FILE__
|
642
|
-
optional :string, :datacenter, 1
|
643
|
-
required :TableRef, :table_ref, 3
|
644
|
-
optional :string, :primary_key, 4, :default => "id"
|
645
|
-
optional :int64, :cache_size, 5, :default => 1073741824
|
646
|
-
end
|
647
|
-
optional :CreateTable, :create_table, 3
|
648
|
-
optional :TableRef, :drop_table, 4
|
649
|
-
end
|
650
|
-
class Query < ::Protobuf::Message
|
651
|
-
defined_in __FILE__
|
652
|
-
class QueryType < ::Protobuf::Enum
|
653
|
-
defined_in __FILE__
|
654
|
-
READ = value(:READ, 1)
|
655
|
-
WRITE = value(:WRITE, 2)
|
656
|
-
CONTINUE = value(:CONTINUE, 3)
|
657
|
-
STOP = value(:STOP, 4)
|
658
|
-
META = value(:META, 5)
|
659
|
-
end
|
660
|
-
required :QueryType, :type, 1
|
661
|
-
required :int64, :token, 2
|
662
|
-
optional :ReadQuery, :read_query, 3
|
663
|
-
optional :WriteQuery, :write_query, 4
|
664
|
-
optional :MetaQuery, :meta_query, 5
|
665
|
-
end
|
666
|
-
class Response < ::Protobuf::Message
|
667
|
-
defined_in __FILE__
|
668
|
-
class StatusCode < ::Protobuf::Enum
|
669
|
-
defined_in __FILE__
|
670
|
-
SUCCESS_EMPTY = value(:SUCCESS_EMPTY, 0)
|
671
|
-
SUCCESS_JSON = value(:SUCCESS_JSON, 1)
|
672
|
-
SUCCESS_PARTIAL = value(:SUCCESS_PARTIAL, 2)
|
673
|
-
SUCCESS_STREAM = value(:SUCCESS_STREAM, 3)
|
674
|
-
BROKEN_CLIENT = value(:BROKEN_CLIENT, 101)
|
675
|
-
BAD_QUERY = value(:BAD_QUERY, 102)
|
676
|
-
RUNTIME_ERROR = value(:RUNTIME_ERROR, 103)
|
677
|
-
end
|
678
|
-
required :StatusCode, :status_code, 1
|
679
|
-
required :int64, :token, 2
|
680
|
-
repeated :string, :response, 3
|
681
|
-
optional :string, :error_message, 4
|
682
|
-
class Backtrace < ::Protobuf::Message
|
683
|
-
defined_in __FILE__
|
684
|
-
repeated :string, :frame, 1
|
685
|
-
end
|
686
|
-
optional :Backtrace, :backtrace, 5
|
687
|
-
end
|