1
0
Fork 0
You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

134 lines
2.2 KiB
Protocol Buffer

syntax = "proto3";
package command;
option go_package = "github.com/rqlite/rqlite/command";
message Parameter {
oneof value {
sint64 i = 1;
double d = 2;
bool b = 3;
bytes y = 4;
string s = 5;
}
string name = 6;
}
message Statement {
string sql = 1;
repeated Parameter parameters = 2;
}
message Request {
bool transaction = 1;
repeated Statement statements = 2;
}
message QueryRequest {
Request request = 1;
bool timings = 2;
enum Level {
QUERY_REQUEST_LEVEL_NONE = 0;
QUERY_REQUEST_LEVEL_WEAK = 1;
QUERY_REQUEST_LEVEL_STRONG = 2;
}
Level level = 3;
int64 freshness = 4;
}
message Values {
repeated Parameter parameters = 1;
}
message QueryRows {
repeated string columns = 1;
repeated string types = 2;
repeated Values values = 3;
string error = 4;
double time = 5;
}
message ExecuteRequest {
Request request = 1;
bool timings = 2;
}
message ExecuteResult {
int64 last_insert_id = 1;
int64 rows_affected = 2;
string error = 3;
double time = 4;
}
message ExecuteQueryRequest {
Request request = 1;
bool timings = 2;
QueryRequest.Level level = 3;
int64 freshness = 4;
}
message ExecuteQueryResponse {
oneof result {
QueryRows q = 1;
ExecuteResult e = 2;
string error = 3;
}
}
message BackupRequest {
enum Format {
BACKUP_REQUEST_FORMAT_NONE = 0;
BACKUP_REQUEST_FORMAT_SQL = 1;
BACKUP_REQUEST_FORMAT_BINARY = 2;
}
Format format = 1;
bool Leader = 2;
bool Vacuum = 3;
}
message LoadRequest {
bytes data = 1;
}
message LoadChunkRequest {
string stream_id = 1;
int64 sequence_num = 2;
bool is_last = 3;
bytes data = 4;
bool abort = 5;
}
message JoinRequest {
string id = 1;
string address = 2;
bool voter = 3;
}
message NotifyRequest {
string id = 1;
string address = 2;
}
message RemoveNodeRequest {
string id = 1;
}
message Noop {
string id = 1;
}
message Command {
enum Type {
COMMAND_TYPE_UNKNOWN = 0;
COMMAND_TYPE_QUERY = 1;
COMMAND_TYPE_EXECUTE = 2;
COMMAND_TYPE_NOOP = 3;
COMMAND_TYPE_LOAD = 4;
COMMAND_TYPE_JOIN = 5;
COMMAND_TYPE_EXECUTE_QUERY = 6;
COMMAND_TYPE_LOAD_CHUNK = 7;
}
Type type = 1;
bytes sub_command = 2;
bool compressed = 3;
}