rethinkdb 1.12.0.2 → 1.13.0.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/func.rb +19 -19
- data/lib/net.rb +96 -87
- data/lib/ql2.pb.rb +219 -323
- data/lib/rethinkdb.rb +3 -43
- data/lib/rpp.rb +108 -73
- data/lib/shim.rb +75 -189
- metadata +4 -32
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 5777270a3f099a47a14f191c5da7bdd9c1b10dc8
|
4
|
+
data.tar.gz: de263295afd0c0e85e05c8b2f89ff371f9339014
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 68982ecf1adac91ef225ed495ad2447f5b8e089a6a6313e68e1f8f986e8bd0130b82a5eedb82cc411bdc6534ebba6dc96846e40b2ba6ccfedfef0a3b01340ea3
|
7
|
+
data.tar.gz: 6fdfea2322bccdc0ac59b13b940d4a0fca748157d016d1077e4ab130ac0eb03eb04fc98162387e46b0da6dc57cb5f6b3672d63adf75e4b92d5cc959a86ae61a2
|
data/lib/func.rb
CHANGED
@@ -1,8 +1,9 @@
|
|
1
1
|
module RethinkDB
|
2
2
|
class RQL
|
3
|
+
@@gensym_mutex = Mutex.new
|
3
4
|
@@gensym_cnt = 0
|
4
5
|
def new_func(&b)
|
5
|
-
args = (0...b.arity).map{@@gensym_cnt += 1}
|
6
|
+
args = @@gensym_mutex.synchronize{(0...b.arity).map{@@gensym_cnt += 1}}
|
6
7
|
body = b.call(*(args.map{|i| RQL.new.var i}))
|
7
8
|
RQL.new.func(args, body)
|
8
9
|
end
|
@@ -33,7 +34,9 @@ module RethinkDB
|
|
33
34
|
:orderby => -1,
|
34
35
|
:group => -1,
|
35
36
|
:iso8601 => -1,
|
36
|
-
:index_create => -1
|
37
|
+
:index_create => -1,
|
38
|
+
:random => -1,
|
39
|
+
:http => 1
|
37
40
|
}
|
38
41
|
@@method_aliases = {
|
39
42
|
:lt => :<,
|
@@ -53,7 +56,6 @@ module RethinkDB
|
|
53
56
|
:javascript => :js,
|
54
57
|
:typeof => :type_of
|
55
58
|
}
|
56
|
-
@@allow_json = {:INSERT => true}
|
57
59
|
|
58
60
|
termtypes = Term::TermType.constants.map{ |c| c.to_sym }
|
59
61
|
termtypes.each {|termtype|
|
@@ -86,17 +88,13 @@ module RethinkDB
|
|
86
88
|
optargs = a.delete_at(opt_offset) if a[opt_offset].class == Hash
|
87
89
|
end
|
88
90
|
|
89
|
-
args = (@body ? [self] : []) + a + (b ? [new_func(&b)] : [])
|
90
|
-
|
91
|
-
t = Term.
|
92
|
-
|
93
|
-
|
94
|
-
|
95
|
-
|
96
|
-
ap.key = k.to_s
|
97
|
-
ap.val = RQL.new.expr(v, :allow_json => @@allow_json[termtype]).to_pb
|
98
|
-
ap
|
99
|
-
}
|
91
|
+
args = ((@body != RQL) ? [self] : []) + a + (b ? [new_func(&b)] : [])
|
92
|
+
|
93
|
+
t = [Term::TermType.const_get(termtype),
|
94
|
+
args.map {|x| RQL.new.expr(x).to_pb},
|
95
|
+
*((optargs && optargs != {}) ?
|
96
|
+
[Hash[optargs.map {|k,v| [k.to_s, RQL.new.expr(v).to_pb]}]] :
|
97
|
+
[])]
|
100
98
|
return RQL.new(t, bitop)
|
101
99
|
}
|
102
100
|
|
@@ -108,7 +106,7 @@ module RethinkDB
|
|
108
106
|
}
|
109
107
|
|
110
108
|
def connect(*args, &b)
|
111
|
-
unbound_if @body
|
109
|
+
unbound_if @body != RQL
|
112
110
|
c = Connection.new(*args)
|
113
111
|
b ? begin b.call(c) ensure c.close end : c
|
114
112
|
end
|
@@ -133,19 +131,21 @@ module RethinkDB
|
|
133
131
|
you want a query that does equality comparison.
|
134
132
|
|
135
133
|
If you need to see whether two queries are the same, compare
|
136
|
-
|
134
|
+
the raw qeuries like: `query1.to_pb == query2.to_pb`."
|
137
135
|
end
|
138
136
|
|
139
137
|
def do(*args, &b)
|
140
|
-
a = (@body ? [self] : []) + args.dup
|
138
|
+
a = ((@body != RQL) ? [self] : []) + args.dup
|
141
139
|
if a == [] && !b
|
142
140
|
raise RqlDriverError, "Expected 1 or more argument(s) but found 0."
|
143
141
|
end
|
144
|
-
|
142
|
+
funcall_args = (b ? [new_func(&b)] : [a.pop]) + a
|
143
|
+
# PP.pp funcall_args
|
144
|
+
RQL.new.funcall(*funcall_args)
|
145
145
|
end
|
146
146
|
|
147
147
|
def row
|
148
|
-
unbound_if
|
148
|
+
unbound_if(@body != RQL)
|
149
149
|
raise NoMethodError, ("Sorry, r.row is not available in the ruby driver. " +
|
150
150
|
"Use blocks instead.")
|
151
151
|
end
|
data/lib/net.rb
CHANGED
@@ -1,19 +1,8 @@
|
|
1
|
-
# Copyright 2010-2012 RethinkDB, all rights reserved.
|
2
1
|
require 'socket'
|
3
2
|
require 'thread'
|
4
3
|
require 'timeout'
|
5
4
|
|
6
|
-
# $f = File.open("fuzz_seed.rb", "w")
|
7
|
-
|
8
5
|
module RethinkDB
|
9
|
-
def self.new_query(type, token)
|
10
|
-
q = Query.new
|
11
|
-
q.type = type
|
12
|
-
q.accepts_r_json = true
|
13
|
-
q.token = token
|
14
|
-
return q
|
15
|
-
end
|
16
|
-
|
17
6
|
module Faux_Abort
|
18
7
|
class Abort
|
19
8
|
end
|
@@ -23,8 +12,7 @@ module RethinkDB
|
|
23
12
|
@@default_conn = nil
|
24
13
|
def self.set_default_conn c; @@default_conn = c; end
|
25
14
|
def run(c=@@default_conn, opts=nil, &b)
|
26
|
-
|
27
|
-
unbound_if !@body
|
15
|
+
unbound_if(@body == RQL)
|
28
16
|
c, opts = @@default_conn, c if opts.nil? && !c.kind_of?(RethinkDB::Connection)
|
29
17
|
opts = {} if opts.nil?
|
30
18
|
opts = {opts => true} if opts.class != Hash
|
@@ -75,6 +63,7 @@ module RethinkDB
|
|
75
63
|
@conn = connection
|
76
64
|
@opts = opts
|
77
65
|
@token = token
|
66
|
+
fetch_batch
|
78
67
|
end
|
79
68
|
|
80
69
|
def each (&block) # :nodoc:
|
@@ -84,11 +73,12 @@ module RethinkDB
|
|
84
73
|
while true
|
85
74
|
@results.each(&block)
|
86
75
|
return self if !@more
|
87
|
-
|
88
|
-
res = @conn.run_internal q
|
76
|
+
res = @conn.wait(@token)
|
89
77
|
@results = Shim.response_to_native(res, @msg, @opts)
|
90
|
-
if res
|
78
|
+
if res['t'] == Response::ResponseType::SUCCESS_SEQUENCE
|
91
79
|
@more = false
|
80
|
+
else
|
81
|
+
fetch_batch
|
92
82
|
end
|
93
83
|
end
|
94
84
|
end
|
@@ -96,14 +86,19 @@ module RethinkDB
|
|
96
86
|
def close
|
97
87
|
if @more
|
98
88
|
@more = false
|
99
|
-
q =
|
100
|
-
res = @conn.run_internal
|
101
|
-
if res
|
89
|
+
q = [Query::QueryType::STOP]
|
90
|
+
res = @conn.run_internal(q, @opts, @token)
|
91
|
+
if res['t'] != Response::ResponseType::SUCCESS_SEQUENCE || res.response != []
|
102
92
|
raise RqlRuntimeError, "Server sent malformed STOP response #{PP.pp(res, "")}"
|
103
93
|
end
|
104
94
|
return true
|
105
95
|
end
|
106
96
|
end
|
97
|
+
|
98
|
+
def fetch_batch
|
99
|
+
@conn.set_opts(@token, @opts)
|
100
|
+
@conn.dispatch([Query::QueryType::CONTINUE], @token)
|
101
|
+
end
|
107
102
|
end
|
108
103
|
|
109
104
|
class Connection
|
@@ -134,48 +129,53 @@ module RethinkDB
|
|
134
129
|
attr_reader :default_db, :conn_id
|
135
130
|
|
136
131
|
@@token_cnt = 0
|
137
|
-
def
|
138
|
-
|
139
|
-
|
132
|
+
def set_opts(token, opts)
|
133
|
+
@mutex.synchronize{@opts[token] = opts}
|
134
|
+
end
|
135
|
+
def run_internal(q, opts, token)
|
136
|
+
set_opts(token, opts)
|
137
|
+
noreply = opts[:noreply]
|
138
|
+
|
139
|
+
dispatch(q, token)
|
140
|
+
noreply ? nil : wait(token)
|
140
141
|
end
|
141
142
|
def run(msg, opts, &b)
|
142
143
|
reconnect(:noreply_wait => false) if @auto_reconnect && (!@socket || !@listener)
|
143
144
|
raise RqlRuntimeError, "Error: Connection Closed." if !@socket || !@listener
|
144
|
-
q = RethinkDB::new_query(Query::QueryType::START, @@token_cnt += 1)
|
145
|
-
q.query = msg
|
146
145
|
|
146
|
+
global_optargs = {}
|
147
147
|
all_opts = @default_opts.merge(opts)
|
148
148
|
if all_opts.keys.include?(:noreply)
|
149
149
|
all_opts[:noreply] = !!all_opts[:noreply]
|
150
150
|
end
|
151
|
-
all_opts.each {|k,v|
|
152
|
-
ap = Query::AssocPair.new
|
153
|
-
ap.key = k.to_s
|
154
|
-
if v.class == RQL
|
155
|
-
ap.val = v.to_pb
|
156
|
-
else
|
157
|
-
ap.val = RQL.new.expr(v).to_pb
|
158
|
-
end
|
159
|
-
q.global_optargs << ap
|
160
|
-
}
|
161
151
|
|
162
|
-
|
152
|
+
token = (@@token_cnt += 1)
|
153
|
+
q = [Query::QueryType::START,
|
154
|
+
msg,
|
155
|
+
Hash[all_opts.map {|k,v|
|
156
|
+
[k.to_s, (v.class == RQL ? v.to_pb : RQL.new.expr(v).to_pb)]
|
157
|
+
}]]
|
158
|
+
|
159
|
+
res = run_internal(q, all_opts, token)
|
163
160
|
return res if !res
|
164
|
-
if res
|
161
|
+
if res['t'] == Response::ResponseType::SUCCESS_PARTIAL ||
|
162
|
+
res['t'] == Response::ResponseType::SUCCESS_FEED
|
165
163
|
value = Cursor.new(Shim.response_to_native(res, msg, opts),
|
166
|
-
|
167
|
-
elsif res
|
164
|
+
msg, self, opts, token, true)
|
165
|
+
elsif res['t'] == Response::ResponseType::SUCCESS_SEQUENCE
|
168
166
|
value = Cursor.new(Shim.response_to_native(res, msg, opts),
|
169
|
-
msg, self, opts,
|
167
|
+
msg, self, opts, token, false)
|
170
168
|
else
|
171
169
|
value = Shim.response_to_native(res, msg, opts)
|
172
170
|
end
|
173
171
|
|
174
|
-
if res
|
175
|
-
|
176
|
-
|
172
|
+
if res['p']
|
173
|
+
real_val = {
|
174
|
+
"profile" => res['p'],
|
175
|
+
"value" => value
|
176
|
+
}
|
177
177
|
else
|
178
|
-
|
178
|
+
real_val = value
|
179
179
|
end
|
180
180
|
|
181
181
|
if b
|
@@ -193,12 +193,11 @@ module RethinkDB
|
|
193
193
|
@socket.write(packet)
|
194
194
|
end
|
195
195
|
|
196
|
-
def dispatch
|
197
|
-
|
198
|
-
|
199
|
-
|
200
|
-
|
201
|
-
return msg.token
|
196
|
+
def dispatch(msg, token)
|
197
|
+
payload = Shim.dump_json(msg).force_encoding('BINARY')
|
198
|
+
prefix = [token, payload.bytesize].pack('Q<L<')
|
199
|
+
send(prefix + payload)
|
200
|
+
return token
|
202
201
|
end
|
203
202
|
|
204
203
|
def wait token
|
@@ -231,7 +230,8 @@ module RethinkDB
|
|
231
230
|
end
|
232
231
|
|
233
232
|
@@last = nil
|
234
|
-
@@magic_number = VersionDummy::Version::
|
233
|
+
@@magic_number = VersionDummy::Version::V0_3
|
234
|
+
@@wire_protocol = VersionDummy::Protocol::JSON
|
235
235
|
|
236
236
|
def debug_socket; @socket; end
|
237
237
|
|
@@ -249,9 +249,10 @@ module RethinkDB
|
|
249
249
|
self.noreply_wait() if opts[:noreply_wait]
|
250
250
|
|
251
251
|
stop_listener
|
252
|
-
@socket.close if @socket
|
252
|
+
@socket.close rescue nil if @socket
|
253
253
|
@socket = TCPSocket.open(@host, @port)
|
254
254
|
@waiters = {}
|
255
|
+
@opts = {}
|
255
256
|
@data = {}
|
256
257
|
@mutex = Mutex.new
|
257
258
|
@conn_id += 1
|
@@ -277,9 +278,9 @@ module RethinkDB
|
|
277
278
|
|
278
279
|
def noreply_wait
|
279
280
|
raise RqlRuntimeError, "Error: Connection Closed." if !@socket || !@listener
|
280
|
-
q =
|
281
|
-
res = run_internal(q)
|
282
|
-
if res
|
281
|
+
q = [Query::QueryType::NOREPLY_WAIT]
|
282
|
+
res = run_internal(q, {noreply: false}, @@token_cnt += 1)
|
283
|
+
if res['t'] != Response::ResponseType::WAIT_COMPLETE
|
283
284
|
raise RqlRuntimeError, "Unexpected response to noreply_wait: " + PP.pp(res, "")
|
284
285
|
end
|
285
286
|
nil
|
@@ -298,6 +299,21 @@ module RethinkDB
|
|
298
299
|
end
|
299
300
|
end
|
300
301
|
|
302
|
+
def note_data(token, data) # Synchronize around this!
|
303
|
+
@data[token] = data
|
304
|
+
@opts.delete(token)
|
305
|
+
@waiters.delete(token).signal if @waiters[token]
|
306
|
+
end
|
307
|
+
|
308
|
+
def note_error(token, e) # Synchronize around this!
|
309
|
+
data = {
|
310
|
+
't' => 16,
|
311
|
+
'r' => [e.inspect],
|
312
|
+
'b' => []
|
313
|
+
}
|
314
|
+
note_data(token, data)
|
315
|
+
end
|
316
|
+
|
301
317
|
def start_listener
|
302
318
|
class << @socket
|
303
319
|
def maybe_timeout(sec=nil, &b)
|
@@ -316,6 +332,7 @@ module RethinkDB
|
|
316
332
|
@socket.write([@@magic_number].pack('L<'))
|
317
333
|
|
318
334
|
@socket.write([@auth_key.size].pack('L<') + @auth_key)
|
335
|
+
@socket.write([@@wire_protocol].pack('L<'))
|
319
336
|
response = ""
|
320
337
|
while response[-1..-1] != "\0"
|
321
338
|
response += @socket.read_exn(1, 20)
|
@@ -327,44 +344,36 @@ module RethinkDB
|
|
327
344
|
|
328
345
|
stop_listener if @listener
|
329
346
|
@listener = Thread.new {
|
330
|
-
|
347
|
+
while true
|
331
348
|
begin
|
349
|
+
token = -1
|
350
|
+
token = @socket.read_exn(8).unpack('q<')[0]
|
332
351
|
response_length = @socket.read_exn(4).unpack('L<')[0]
|
333
352
|
response = @socket.read_exn(response_length)
|
334
|
-
|
335
|
-
|
336
|
-
|
337
|
-
|
338
|
-
|
339
|
-
|
340
|
-
|
341
|
-
|
342
|
-
|
343
|
-
|
344
|
-
|
345
|
-
rescue
|
346
|
-
|
347
|
-
|
348
|
-
|
349
|
-
|
350
|
-
@waiters.keys.each {|k|
|
351
|
-
@data[k] = protob
|
352
|
-
if @waiters[k]
|
353
|
-
cond = @waiters.delete k
|
354
|
-
cond.signal
|
355
|
-
end
|
353
|
+
begin
|
354
|
+
data = Shim.load_json(response, @opts[token])
|
355
|
+
rescue Exception => e
|
356
|
+
raise RqlRuntimeError, "Bad response, server is buggy.\n" +
|
357
|
+
"#{e.inspect}\n" + response
|
358
|
+
end
|
359
|
+
if token == -1
|
360
|
+
@mutex.synchronize{@waiters.keys.each{|k| note_data(k, data)}}
|
361
|
+
else
|
362
|
+
@mutex.synchronize{note_data(token, data)}
|
363
|
+
end
|
364
|
+
rescue Exception => e
|
365
|
+
if token == -1
|
366
|
+
@mutex.synchronize {
|
367
|
+
@listener = nil
|
368
|
+
@waiters.keys.each{|k| note_error(k, e)}
|
356
369
|
}
|
357
|
-
|
358
|
-
|
359
|
-
|
360
|
-
@
|
361
|
-
|
362
|
-
cond = @waiters.delete protob.token
|
363
|
-
cond.signal
|
364
|
-
end
|
365
|
-
}
|
370
|
+
Thread.current.terminate
|
371
|
+
abort("unreachable")
|
372
|
+
else
|
373
|
+
@mutex.synchronize{note_error(token, e)}
|
374
|
+
end
|
366
375
|
end
|
367
|
-
|
376
|
+
end
|
368
377
|
}
|
369
378
|
end
|
370
379
|
end
|
data/lib/ql2.pb.rb
CHANGED
@@ -1,324 +1,220 @@
|
|
1
|
-
|
2
|
-
#
|
3
|
-
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
|
52
|
-
|
53
|
-
|
54
|
-
|
55
|
-
|
56
|
-
|
57
|
-
|
58
|
-
|
59
|
-
|
60
|
-
|
61
|
-
|
62
|
-
|
63
|
-
|
64
|
-
|
65
|
-
|
66
|
-
|
67
|
-
|
68
|
-
|
69
|
-
|
70
|
-
|
71
|
-
|
72
|
-
|
73
|
-
|
74
|
-
|
75
|
-
|
76
|
-
|
77
|
-
|
78
|
-
|
79
|
-
|
80
|
-
|
81
|
-
|
82
|
-
|
83
|
-
|
84
|
-
|
85
|
-
|
86
|
-
|
87
|
-
|
88
|
-
|
89
|
-
|
1
|
+
# DO NOT EDIT
|
2
|
+
# Autogenerated by convert_protofile
|
3
|
+
|
4
|
+
module RethinkDB
|
5
|
+
module VersionDummy
|
6
|
+
module Version
|
7
|
+
V0_1 = 1063369270
|
8
|
+
V0_2 = 1915781601
|
9
|
+
V0_3 = 1601562686
|
10
|
+
end
|
11
|
+
|
12
|
+
module Protocol
|
13
|
+
PROTOBUF = 656407617
|
14
|
+
JSON = 2120839367
|
15
|
+
end
|
16
|
+
end
|
17
|
+
|
18
|
+
module Query
|
19
|
+
module QueryType
|
20
|
+
START = 1
|
21
|
+
CONTINUE = 2
|
22
|
+
STOP = 3
|
23
|
+
NOREPLY_WAIT = 4
|
24
|
+
end
|
25
|
+
|
26
|
+
module AssocPair
|
27
|
+
end
|
28
|
+
end
|
29
|
+
|
30
|
+
module Frame
|
31
|
+
module FrameType
|
32
|
+
POS = 1
|
33
|
+
OPT = 2
|
34
|
+
end
|
35
|
+
end
|
36
|
+
|
37
|
+
module Backtrace
|
38
|
+
end
|
39
|
+
|
40
|
+
module Response
|
41
|
+
module ResponseType
|
42
|
+
SUCCESS_ATOM = 1
|
43
|
+
SUCCESS_SEQUENCE = 2
|
44
|
+
SUCCESS_PARTIAL = 3
|
45
|
+
SUCCESS_FEED = 5
|
46
|
+
WAIT_COMPLETE = 4
|
47
|
+
CLIENT_ERROR = 16
|
48
|
+
COMPILE_ERROR = 17
|
49
|
+
RUNTIME_ERROR = 18
|
50
|
+
end
|
51
|
+
end
|
52
|
+
|
53
|
+
module Datum
|
54
|
+
module DatumType
|
55
|
+
R_NULL = 1
|
56
|
+
R_BOOL = 2
|
57
|
+
R_NUM = 3
|
58
|
+
R_STR = 4
|
59
|
+
R_ARRAY = 5
|
60
|
+
R_OBJECT = 6
|
61
|
+
R_JSON = 7
|
62
|
+
end
|
63
|
+
|
64
|
+
module AssocPair
|
65
|
+
end
|
66
|
+
end
|
67
|
+
|
68
|
+
module Term
|
69
|
+
module TermType
|
70
|
+
DATUM = 1
|
71
|
+
MAKE_ARRAY = 2
|
72
|
+
MAKE_OBJ = 3
|
73
|
+
VAR = 10
|
74
|
+
JAVASCRIPT = 11
|
75
|
+
HTTP = 153
|
76
|
+
ERROR = 12
|
77
|
+
IMPLICIT_VAR = 13
|
78
|
+
DB = 14
|
79
|
+
TABLE = 15
|
80
|
+
GET = 16
|
81
|
+
GET_ALL = 78
|
82
|
+
EQ = 17
|
83
|
+
NE = 18
|
84
|
+
LT = 19
|
85
|
+
LE = 20
|
86
|
+
GT = 21
|
87
|
+
GE = 22
|
88
|
+
NOT = 23
|
89
|
+
ADD = 24
|
90
|
+
SUB = 25
|
91
|
+
MUL = 26
|
92
|
+
DIV = 27
|
93
|
+
MOD = 28
|
94
|
+
APPEND = 29
|
95
|
+
PREPEND = 80
|
96
|
+
DIFFERENCE = 95
|
97
|
+
SET_INSERT = 88
|
98
|
+
SET_INTERSECTION = 89
|
99
|
+
SET_UNION = 90
|
100
|
+
SET_DIFFERENCE = 91
|
101
|
+
SLICE = 30
|
102
|
+
SKIP = 70
|
103
|
+
LIMIT = 71
|
104
|
+
INDEXES_OF = 87
|
105
|
+
CONTAINS = 93
|
106
|
+
GET_FIELD = 31
|
107
|
+
KEYS = 94
|
108
|
+
OBJECT = 143
|
109
|
+
HAS_FIELDS = 32
|
110
|
+
WITH_FIELDS = 96
|
111
|
+
PLUCK = 33
|
112
|
+
WITHOUT = 34
|
113
|
+
MERGE = 35
|
114
|
+
BETWEEN = 36
|
115
|
+
REDUCE = 37
|
116
|
+
MAP = 38
|
117
|
+
FILTER = 39
|
118
|
+
CONCATMAP = 40
|
119
|
+
ORDERBY = 41
|
120
|
+
DISTINCT = 42
|
121
|
+
COUNT = 43
|
122
|
+
IS_EMPTY = 86
|
123
|
+
UNION = 44
|
124
|
+
NTH = 45
|
125
|
+
INNER_JOIN = 48
|
126
|
+
OUTER_JOIN = 49
|
127
|
+
EQ_JOIN = 50
|
128
|
+
ZIP = 72
|
129
|
+
INSERT_AT = 82
|
130
|
+
DELETE_AT = 83
|
131
|
+
CHANGE_AT = 84
|
132
|
+
SPLICE_AT = 85
|
133
|
+
COERCE_TO = 51
|
134
|
+
TYPEOF = 52
|
135
|
+
UPDATE = 53
|
136
|
+
DELETE = 54
|
137
|
+
REPLACE = 55
|
138
|
+
INSERT = 56
|
139
|
+
DB_CREATE = 57
|
140
|
+
DB_DROP = 58
|
141
|
+
DB_LIST = 59
|
142
|
+
TABLE_CREATE = 60
|
143
|
+
TABLE_DROP = 61
|
144
|
+
TABLE_LIST = 62
|
145
|
+
SYNC = 138
|
146
|
+
INDEX_CREATE = 75
|
147
|
+
INDEX_DROP = 76
|
148
|
+
INDEX_LIST = 77
|
149
|
+
INDEX_STATUS = 139
|
150
|
+
INDEX_WAIT = 140
|
151
|
+
FUNCALL = 64
|
152
|
+
BRANCH = 65
|
153
|
+
ANY = 66
|
154
|
+
ALL = 67
|
155
|
+
FOREACH = 68
|
156
|
+
FUNC = 69
|
157
|
+
ASC = 73
|
158
|
+
DESC = 74
|
159
|
+
INFO = 79
|
160
|
+
MATCH = 97
|
161
|
+
UPCASE = 141
|
162
|
+
DOWNCASE = 142
|
163
|
+
SAMPLE = 81
|
164
|
+
DEFAULT = 92
|
165
|
+
JSON = 98
|
166
|
+
ISO8601 = 99
|
167
|
+
TO_ISO8601 = 100
|
168
|
+
EPOCH_TIME = 101
|
169
|
+
TO_EPOCH_TIME = 102
|
170
|
+
NOW = 103
|
171
|
+
IN_TIMEZONE = 104
|
172
|
+
DURING = 105
|
173
|
+
DATE = 106
|
174
|
+
TIME_OF_DAY = 126
|
175
|
+
TIMEZONE = 127
|
176
|
+
YEAR = 128
|
177
|
+
MONTH = 129
|
178
|
+
DAY = 130
|
179
|
+
DAY_OF_WEEK = 131
|
180
|
+
DAY_OF_YEAR = 132
|
181
|
+
HOURS = 133
|
182
|
+
MINUTES = 134
|
183
|
+
SECONDS = 135
|
184
|
+
TIME = 136
|
185
|
+
MONDAY = 107
|
186
|
+
TUESDAY = 108
|
187
|
+
WEDNESDAY = 109
|
188
|
+
THURSDAY = 110
|
189
|
+
FRIDAY = 111
|
190
|
+
SATURDAY = 112
|
191
|
+
SUNDAY = 113
|
192
|
+
JANUARY = 114
|
193
|
+
FEBRUARY = 115
|
194
|
+
MARCH = 116
|
195
|
+
APRIL = 117
|
196
|
+
MAY = 118
|
197
|
+
JUNE = 119
|
198
|
+
JULY = 120
|
199
|
+
AUGUST = 121
|
200
|
+
SEPTEMBER = 122
|
201
|
+
OCTOBER = 123
|
202
|
+
NOVEMBER = 124
|
203
|
+
DECEMBER = 125
|
204
|
+
LITERAL = 137
|
205
|
+
GROUP = 144
|
206
|
+
SUM = 145
|
207
|
+
AVG = 146
|
208
|
+
MIN = 147
|
209
|
+
MAX = 148
|
210
|
+
SPLIT = 149
|
211
|
+
UNGROUP = 150
|
212
|
+
RANDOM = 151
|
213
|
+
CHANGES = 152
|
214
|
+
ARGS = 154
|
215
|
+
end
|
216
|
+
|
217
|
+
module AssocPair
|
218
|
+
end
|
219
|
+
end
|
90
220
|
end
|
91
|
-
|
92
|
-
class Response < ::ProtocolBuffers::Message
|
93
|
-
# forward declarations
|
94
|
-
|
95
|
-
# enums
|
96
|
-
module ResponseType
|
97
|
-
include ::ProtocolBuffers::Enum
|
98
|
-
|
99
|
-
set_fully_qualified_name "Response.ResponseType"
|
100
|
-
|
101
|
-
SUCCESS_ATOM = 1
|
102
|
-
SUCCESS_SEQUENCE = 2
|
103
|
-
SUCCESS_PARTIAL = 3
|
104
|
-
WAIT_COMPLETE = 4
|
105
|
-
CLIENT_ERROR = 16
|
106
|
-
COMPILE_ERROR = 17
|
107
|
-
RUNTIME_ERROR = 18
|
108
|
-
end
|
109
|
-
|
110
|
-
set_fully_qualified_name "Response"
|
111
|
-
|
112
|
-
optional ::Response::ResponseType, :type, 1
|
113
|
-
optional :int64, :token, 2
|
114
|
-
repeated ::Datum, :response, 3
|
115
|
-
optional ::Backtrace, :backtrace, 4
|
116
|
-
optional ::Datum, :profile, 5
|
117
|
-
end
|
118
|
-
|
119
|
-
class Datum < ::ProtocolBuffers::Message
|
120
|
-
# forward declarations
|
121
|
-
class AssocPair < ::ProtocolBuffers::Message; end
|
122
|
-
|
123
|
-
# enums
|
124
|
-
module DatumType
|
125
|
-
include ::ProtocolBuffers::Enum
|
126
|
-
|
127
|
-
set_fully_qualified_name "Datum.DatumType"
|
128
|
-
|
129
|
-
R_NULL = 1
|
130
|
-
R_BOOL = 2
|
131
|
-
R_NUM = 3
|
132
|
-
R_STR = 4
|
133
|
-
R_ARRAY = 5
|
134
|
-
R_OBJECT = 6
|
135
|
-
R_JSON = 7
|
136
|
-
end
|
137
|
-
|
138
|
-
set_fully_qualified_name "Datum"
|
139
|
-
|
140
|
-
# nested messages
|
141
|
-
class AssocPair < ::ProtocolBuffers::Message
|
142
|
-
set_fully_qualified_name "Datum.AssocPair"
|
143
|
-
|
144
|
-
optional :string, :key, 1
|
145
|
-
optional ::Datum, :val, 2
|
146
|
-
end
|
147
|
-
|
148
|
-
optional ::Datum::DatumType, :type, 1
|
149
|
-
optional :bool, :r_bool, 2
|
150
|
-
optional :double, :r_num, 3
|
151
|
-
optional :string, :r_str, 4
|
152
|
-
repeated ::Datum, :r_array, 5
|
153
|
-
repeated ::Datum::AssocPair, :r_object, 6
|
154
|
-
end
|
155
|
-
|
156
|
-
class Term < ::ProtocolBuffers::Message
|
157
|
-
# forward declarations
|
158
|
-
class AssocPair < ::ProtocolBuffers::Message; end
|
159
|
-
|
160
|
-
# enums
|
161
|
-
module TermType
|
162
|
-
include ::ProtocolBuffers::Enum
|
163
|
-
|
164
|
-
set_fully_qualified_name "Term.TermType"
|
165
|
-
|
166
|
-
DATUM = 1
|
167
|
-
MAKE_ARRAY = 2
|
168
|
-
MAKE_OBJ = 3
|
169
|
-
VAR = 10
|
170
|
-
JAVASCRIPT = 11
|
171
|
-
ERROR = 12
|
172
|
-
IMPLICIT_VAR = 13
|
173
|
-
DB = 14
|
174
|
-
TABLE = 15
|
175
|
-
GET = 16
|
176
|
-
GET_ALL = 78
|
177
|
-
EQ = 17
|
178
|
-
NE = 18
|
179
|
-
LT = 19
|
180
|
-
LE = 20
|
181
|
-
GT = 21
|
182
|
-
GE = 22
|
183
|
-
NOT = 23
|
184
|
-
ADD = 24
|
185
|
-
SUB = 25
|
186
|
-
MUL = 26
|
187
|
-
DIV = 27
|
188
|
-
MOD = 28
|
189
|
-
APPEND = 29
|
190
|
-
PREPEND = 80
|
191
|
-
DIFFERENCE = 95
|
192
|
-
SET_INSERT = 88
|
193
|
-
SET_INTERSECTION = 89
|
194
|
-
SET_UNION = 90
|
195
|
-
SET_DIFFERENCE = 91
|
196
|
-
SLICE = 30
|
197
|
-
SKIP = 70
|
198
|
-
LIMIT = 71
|
199
|
-
INDEXES_OF = 87
|
200
|
-
CONTAINS = 93
|
201
|
-
GET_FIELD = 31
|
202
|
-
KEYS = 94
|
203
|
-
OBJECT = 143
|
204
|
-
HAS_FIELDS = 32
|
205
|
-
WITH_FIELDS = 96
|
206
|
-
PLUCK = 33
|
207
|
-
WITHOUT = 34
|
208
|
-
MERGE = 35
|
209
|
-
BETWEEN = 36
|
210
|
-
REDUCE = 37
|
211
|
-
MAP = 38
|
212
|
-
FILTER = 39
|
213
|
-
CONCATMAP = 40
|
214
|
-
ORDERBY = 41
|
215
|
-
DISTINCT = 42
|
216
|
-
COUNT = 43
|
217
|
-
IS_EMPTY = 86
|
218
|
-
UNION = 44
|
219
|
-
NTH = 45
|
220
|
-
INNER_JOIN = 48
|
221
|
-
OUTER_JOIN = 49
|
222
|
-
EQ_JOIN = 50
|
223
|
-
ZIP = 72
|
224
|
-
INSERT_AT = 82
|
225
|
-
DELETE_AT = 83
|
226
|
-
CHANGE_AT = 84
|
227
|
-
SPLICE_AT = 85
|
228
|
-
COERCE_TO = 51
|
229
|
-
TYPEOF = 52
|
230
|
-
UPDATE = 53
|
231
|
-
DELETE = 54
|
232
|
-
REPLACE = 55
|
233
|
-
INSERT = 56
|
234
|
-
DB_CREATE = 57
|
235
|
-
DB_DROP = 58
|
236
|
-
DB_LIST = 59
|
237
|
-
TABLE_CREATE = 60
|
238
|
-
TABLE_DROP = 61
|
239
|
-
TABLE_LIST = 62
|
240
|
-
SYNC = 138
|
241
|
-
INDEX_CREATE = 75
|
242
|
-
INDEX_DROP = 76
|
243
|
-
INDEX_LIST = 77
|
244
|
-
INDEX_STATUS = 139
|
245
|
-
INDEX_WAIT = 140
|
246
|
-
FUNCALL = 64
|
247
|
-
BRANCH = 65
|
248
|
-
ANY = 66
|
249
|
-
ALL = 67
|
250
|
-
FOREACH = 68
|
251
|
-
FUNC = 69
|
252
|
-
ASC = 73
|
253
|
-
DESC = 74
|
254
|
-
INFO = 79
|
255
|
-
MATCH = 97
|
256
|
-
UPCASE = 141
|
257
|
-
DOWNCASE = 142
|
258
|
-
SAMPLE = 81
|
259
|
-
DEFAULT = 92
|
260
|
-
JSON = 98
|
261
|
-
ISO8601 = 99
|
262
|
-
TO_ISO8601 = 100
|
263
|
-
EPOCH_TIME = 101
|
264
|
-
TO_EPOCH_TIME = 102
|
265
|
-
NOW = 103
|
266
|
-
IN_TIMEZONE = 104
|
267
|
-
DURING = 105
|
268
|
-
DATE = 106
|
269
|
-
TIME_OF_DAY = 126
|
270
|
-
TIMEZONE = 127
|
271
|
-
YEAR = 128
|
272
|
-
MONTH = 129
|
273
|
-
DAY = 130
|
274
|
-
DAY_OF_WEEK = 131
|
275
|
-
DAY_OF_YEAR = 132
|
276
|
-
HOURS = 133
|
277
|
-
MINUTES = 134
|
278
|
-
SECONDS = 135
|
279
|
-
TIME = 136
|
280
|
-
MONDAY = 107
|
281
|
-
TUESDAY = 108
|
282
|
-
WEDNESDAY = 109
|
283
|
-
THURSDAY = 110
|
284
|
-
FRIDAY = 111
|
285
|
-
SATURDAY = 112
|
286
|
-
SUNDAY = 113
|
287
|
-
JANUARY = 114
|
288
|
-
FEBRUARY = 115
|
289
|
-
MARCH = 116
|
290
|
-
APRIL = 117
|
291
|
-
MAY = 118
|
292
|
-
JUNE = 119
|
293
|
-
JULY = 120
|
294
|
-
AUGUST = 121
|
295
|
-
SEPTEMBER = 122
|
296
|
-
OCTOBER = 123
|
297
|
-
NOVEMBER = 124
|
298
|
-
DECEMBER = 125
|
299
|
-
LITERAL = 137
|
300
|
-
GROUP = 144
|
301
|
-
SUM = 145
|
302
|
-
AVG = 146
|
303
|
-
MIN = 147
|
304
|
-
MAX = 148
|
305
|
-
SPLIT = 149
|
306
|
-
UNGROUP = 150
|
307
|
-
end
|
308
|
-
|
309
|
-
set_fully_qualified_name "Term"
|
310
|
-
|
311
|
-
# nested messages
|
312
|
-
class AssocPair < ::ProtocolBuffers::Message
|
313
|
-
set_fully_qualified_name "Term.AssocPair"
|
314
|
-
|
315
|
-
optional :string, :key, 1
|
316
|
-
optional ::Term, :val, 2
|
317
|
-
end
|
318
|
-
|
319
|
-
optional ::Term::TermType, :type, 1
|
320
|
-
optional ::Datum, :datum, 2
|
321
|
-
repeated ::Term, :args, 3
|
322
|
-
repeated ::Term::AssocPair, :optargs, 4
|
323
|
-
end
|
324
|
-
|