mirror of
https://github.com/GreptimeTeam/greptimedb.git
synced 2026-01-03 20:02:54 +00:00
82 lines
1.8 KiB
Protocol Buffer
82 lines
1.8 KiB
Protocol Buffer
syntax = "proto3";
|
|
|
|
package greptime.v1;
|
|
|
|
import "greptime/v1/common.proto";
|
|
|
|
message DatabaseRequest {
|
|
string name = 1;
|
|
repeated ObjectExpr exprs = 2;
|
|
}
|
|
|
|
message DatabaseResponse {
|
|
repeated ObjectResult results = 1;
|
|
}
|
|
|
|
message ObjectExpr {
|
|
ExprHeader header = 1;
|
|
oneof expr {
|
|
InsertExpr insert = 2;
|
|
SelectExpr select = 3;
|
|
UpdateExpr update = 4;
|
|
DeleteExpr delete = 5;
|
|
}
|
|
}
|
|
|
|
// TODO(fys): Only support sql now, and will support promql etc in the future
|
|
message SelectExpr {
|
|
oneof expr {
|
|
string sql = 1;
|
|
bytes logical_plan = 2;
|
|
PhysicalPlan physical_plan = 15;
|
|
}
|
|
}
|
|
|
|
message PhysicalPlan {
|
|
bytes original_ql = 1;
|
|
bytes plan = 2;
|
|
}
|
|
|
|
message InsertExpr {
|
|
string schema_name = 1;
|
|
string table_name = 2;
|
|
|
|
message Values {
|
|
repeated bytes values = 1;
|
|
}
|
|
|
|
oneof expr {
|
|
Values values = 3;
|
|
|
|
// TODO(LFC): Remove field "sql" in InsertExpr.
|
|
// When Frontend instance received an insertion SQL (`insert into ...`), it's anticipated to parse the SQL and
|
|
// assemble the values to insert to feed Datanode. In other words, inserting data through Datanode instance's GRPC
|
|
// interface shouldn't use SQL directly.
|
|
// Then why the "sql" field exists here? It's because the Frontend needs table schema to create the values to insert,
|
|
// which is currently not able to find anywhere. (Maybe the table schema is suppose to be fetched from Meta?)
|
|
// The "sql" field is meant to be removed in the future.
|
|
string sql = 4;
|
|
}
|
|
|
|
/// The region number of current insert request.
|
|
uint32 region_number = 5;
|
|
map<string, bytes> options = 6;
|
|
}
|
|
|
|
// TODO(jiachun)
|
|
message UpdateExpr {}
|
|
// TODO(jiachun)
|
|
message DeleteExpr {}
|
|
|
|
message ObjectResult {
|
|
ResultHeader header = 1;
|
|
oneof result {
|
|
SelectResult select = 2;
|
|
MutateResult mutate = 3;
|
|
}
|
|
}
|
|
|
|
message SelectResult {
|
|
bytes raw_data = 1;
|
|
}
|