Files
orion_greptime_proto/proto/greptime/v1/database.proto
T
Ruihang Xia d32c9d5e98 chore: add license header (#35)
Signed-off-by: Ruihang Xia <waynestxia@gmail.com>
2023-05-18 14:27:17 +08:00

86 lines
2.2 KiB
Protocol Buffer

// Copyright 2023 Greptime Team
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
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";
import "greptime/v1/prom.proto";
import "greptime/v1/common.proto";
service GreptimeDatabase {
rpc Handle(GreptimeRequest) returns (GreptimeResponse);
rpc HandleRequests(stream GreptimeRequest) returns (GreptimeResponse);
}
message GreptimeRequest {
RequestHeader header = 1;
oneof request {
InsertRequest insert = 2;
QueryRequest query = 3;
DdlRequest ddl = 4;
DeleteRequest delete = 5;
}
}
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 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 DeleteRequest {
// The table name to delete from. Catalog name and schema name are in the
// `RequestHeader`.
string table_name = 1;
// The region number of current delete request.
uint32 region_number = 2;
// The data to delete, indexed by key columns.
repeated Column key_columns = 3;
// The row count of all columns above.
uint32 row_count = 4;
}