Files
orion_greptime_proto/proto/greptime/v1/database.proto
T
Ning Sun ff8c55bed0 feat: add dbname and health check api (#18)
* feat: add dbname field in proto

* feat: add health check service

* fix: enum must start from 0

* chore: check in generated go sources

* refactor: remove health check response content

* chore: generate go sources
2023-03-26 23:01:54 +08:00

100 lines
2.0 KiB
Protocol Buffer

syntax = "proto3";
package greptime.v1;
option java_package = "io.greptime.v1";
option java_outer_classname = "Database";
option go_package = "github.com/GreptimeTeam/greptime-proto/go/greptime/v1";
import "greptime/v1/ddl.proto";
import "greptime/v1/column.proto";
service GreptimeDatabase {
rpc Handle(GreptimeRequest) returns (GreptimeResponse);
rpc HandleRequests(stream GreptimeRequest) returns (GreptimeResponse);
}
message RequestHeader {
// The `catalog` that is selected to be used in this request.
string catalog = 1;
// The `schema` that is selected to be used in this request.
string schema = 2;
// The `authorization` header, much like http's authorization header.
AuthHeader authorization = 3;
// The `dbname` for the request
string dbname = 4;
}
message AuthHeader {
oneof auth_scheme {
Basic basic = 1;
Token token = 2;
}
}
message Basic {
string username = 1;
string password = 2;
}
message Token {
string token = 1;
}
message GreptimeRequest {
RequestHeader header = 1;
oneof request {
InsertRequest insert = 2;
QueryRequest query = 3;
DdlRequest ddl = 4;
}
}
message ResponseHeader {}
message GreptimeResponse {
ResponseHeader header = 1;
oneof response {
AffectedRows affected_rows = 2;
}
}
message QueryRequest {
oneof query {
string sql = 1;
bytes logical_plan = 2;
PromRangeQuery prom_range_query = 3;
}
}
message PromRangeQuery {
string query = 1;
string start = 2;
string end = 3;
string step = 4;
}
message InsertRequest {
string table_name = 1;
// Data is represented here.
repeated Column columns = 3;
// The row_count of all columns, which include null and non-null values.
//
// Note: the row_count of all columns in a InsertRequest must be same.
uint32 row_count = 4;
// The region number of current insert request.
uint32 region_number = 5;
}
message AffectedRows {
uint32 value = 1;
}
message FlightMetadata {
AffectedRows affected_rows = 1;
}