Skip to content

Commit

Permalink
Newer proto
Browse files Browse the repository at this point in the history
  • Loading branch information
apa512 committed May 11, 2015
1 parent 9d6b8c1 commit ad92ff4
Show file tree
Hide file tree
Showing 2 changed files with 41 additions and 11 deletions.
2 changes: 1 addition & 1 deletion project.clj
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
(defproject rethinkdb-protobuf "0.2.0"
(defproject rethinkdb-protobuf "0.3.0"
:description "Protobufs for RethinkDB version 1.16.x"
:url "http://github.com/apa512/clj-rethinkdb"
:license {:name "Eclipse Public License"
Expand Down
50 changes: 40 additions & 10 deletions resources/proto/ql2.proto
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@ message VersionDummy { // We need to wrap it like this for some
V0_1 = 0x3f61ba36;
V0_2 = 0x723081e1; // Authorization key during handshake
V0_3 = 0x5f75e83e; // Authorization key and protocol during handshake
V0_4 = 0x400c2d20; // Queries execute in parallel
}

// The protocol to use after the handshake, specified in V0_3
Expand Down Expand Up @@ -118,9 +119,7 @@ message Response {
// the same token as this response, you will get
// more of the sequence. Keep sending [CONTINUE]
// queries until you get back [SUCCESS_SEQUENCE].
SUCCESS_FEED = 5; // Like [SUCCESS_PARTIAL] but for feeds.
WAIT_COMPLETE = 4; // A [NOREPLY_WAIT] query completed.
SUCCESS_ATOM_FEED = 6; // Like [SUCCESS_FEED] but a singleton.

// These response types indicate failure.
CLIENT_ERROR = 16; // Means the client is buggy. An example is if the
Expand All @@ -135,6 +134,31 @@ message Response {
// than numbers.
}
optional ResponseType type = 1;

// ResponseNotes are used to provide information about the query
// response that may be useful for people writing drivers or ORMs.
// Currently all the notes we send indicate that a stream has certain
// special properties.
enum ResponseNote {
// The stream is a changefeed stream (e.g. `r.table('test').changes()`).
SEQUENCE_FEED = 1;
// The stream is a point changefeed stream
// (e.g. `r.table('test').get(0).changes()`).
ATOM_FEED = 2;
// The stream is an order_by_limit changefeed stream
// (e.g. `r.table('test').order_by(index: 'id').limit(5).changes()`).
ORDER_BY_LIMIT_FEED = 3;
// The stream is a union of multiple changefeed types that can't be
// collapsed to a single type
// (e.g. `r.table('test').changes().union(r.table('test').get(0).changes())`).
UNIONED_FEED = 4;
// The stream is a changefeed stream and includes notes on what state
// the changefeed stream is in (e.g. objects of the form `{state:
// 'initializing'}`).
INCLUDES_STATES = 5;
}
repeated ResponseNote notes = 6;

optional int64 token = 2; // Indicates what [Query] this response corresponds to.

// [response] contains 1 RQL datum if [type] is [SUCCESS_ATOM], or many RQL
Expand Down Expand Up @@ -332,7 +356,7 @@ message Term {
SLICE = 30; // Sequence, NUMBER, NUMBER -> Sequence
SKIP = 70; // Sequence, NUMBER -> Sequence
LIMIT = 71; // Sequence, NUMBER -> Sequence
INDEXES_OF = 87; // Sequence, DATUM -> Sequence | Sequence, Function(1) -> Sequence
OFFSETS_OF = 87; // Sequence, DATUM -> Sequence | Sequence, Function(1) -> Sequence
CONTAINS = 93; // Sequence, DATUM -> BOOL | Sequence, Function(1) -> BOOL

// Stream/Object Ops
Expand Down Expand Up @@ -364,7 +388,9 @@ message Term {
// Half-open by default, but the openness of either side can be
// changed by passing 'closed' or 'open for `right_bound` or
// `left_bound`.
BETWEEN = 36; // StreamSelection, DATUM, DATUM, {index:!STRING, right_bound:STRING, left_bound:STRING} -> StreamSelection
BETWEEN_DEPRECATED = 36; // Deprecated version of between, which allows `null` to specify unboundedness
// With the newer version, clients should use `r.minval` and `r.maxval` for unboundedness
BETWEEN = 182; // StreamSelection, DATUM, DATUM, {index:!STRING, right_bound:STRING, left_bound:STRING} -> StreamSelection
REDUCE = 37; // Sequence, Function(2) -> DATUM
MAP = 38; // Sequence, Function(1) -> Sequence
// The arity of the function should be
Expand Down Expand Up @@ -520,11 +546,9 @@ message Term {
// statement).
BRANCH = 65; // BOOL, Top, Top -> Top
// Returns true if any of its arguments returns true (short-circuits).
// (Like `or` in most languages.)
ANY = 66; // BOOL... -> BOOL
OR = 66; // BOOL... -> BOOL
// Returns true if all of its arguments return true (short-circuits).
// (Like `and` in most languages.)
ALL = 67; // BOOL... -> BOOL
AND = 67; // BOOL... -> BOOL
// Calls its Function with each entry in the sequence
// and executes the array of terms that Function returns.
FOR_EACH = 68; // Sequence, Function(1) -> OBJECT
Expand Down Expand Up @@ -671,8 +695,10 @@ message Term {
NOVEMBER = 124; // -> 11
DECEMBER = 125; // -> 12

// Indicates to MERGE to replace the other object rather than merge it.
LITERAL = 137; // JSON -> Merging
// Indicates to MERGE to replace, or remove in case of an empty literal, the
// other object rather than merge it.
LITERAL = 137; // -> Merging
// JSON -> Merging

// SEQUENCE, STRING -> GROUPED_SEQUENCE | SEQUENCE, FUNCTION -> GROUPED_SEQUENCE
GROUP = 144;
Expand Down Expand Up @@ -711,6 +737,10 @@ message Term {
FILL = 167; // PSEUDOTYPE(GEOMETRY) -> PSEUDOTYPE(GEOMETRY)
GET_NEAREST = 168; // TABLE, PSEUDOTYPE(GEOMETRY) {index:!STRING, max_results:NUM, max_dist:NUM, geo_system:STRING, unit:STRING} -> ARRAY
POLYGON_SUB = 171; // PSEUDOTYPE(GEOMETRY), PSEUDOTYPE(GEOMETRY) -> PSEUDOTYPE(GEOMETRY)

// Constants for specifying key ranges
MINVAL = 180;
MAXVAL = 181;
}
optional TermType type = 1;

Expand Down

0 comments on commit ad92ff4

Please sign in to comment.