59 lines
1.2 KiB
Protocol Buffer
59 lines
1.2 KiB
Protocol Buffer
// common/proto/table_definition.proto
|
|
syntax = "proto3";
|
|
package multieko2.table_definition;
|
|
|
|
import "common.proto";
|
|
|
|
service TableDefinition {
|
|
rpc PostTableDefinition (PostTableDefinitionRequest) returns (TableDefinitionResponse);
|
|
rpc GetProfileTree (multieko2.common.Empty) returns (ProfileTreeResponse);
|
|
rpc DeleteTable (DeleteTableRequest) returns (DeleteTableResponse);
|
|
}
|
|
|
|
message TableLink {
|
|
string linked_table_name = 1;
|
|
bool required = 2;
|
|
}
|
|
|
|
message PostTableDefinitionRequest {
|
|
string table_name = 1;
|
|
repeated TableLink links = 2;
|
|
repeated ColumnDefinition columns = 3;
|
|
repeated string indexes = 4;
|
|
string profile_name = 5;
|
|
}
|
|
|
|
message ColumnDefinition {
|
|
string name = 1;
|
|
string field_type = 2;
|
|
}
|
|
|
|
message TableDefinitionResponse {
|
|
bool success = 1;
|
|
string sql = 2;
|
|
}
|
|
|
|
message ProfileTreeResponse {
|
|
message Table {
|
|
string name = 1;
|
|
repeated string depends_on = 2;
|
|
}
|
|
|
|
message Profile {
|
|
string name = 1;
|
|
repeated Table tables = 2;
|
|
}
|
|
|
|
repeated Profile profiles = 1;
|
|
}
|
|
|
|
message DeleteTableRequest {
|
|
string profile_name = 1;
|
|
string table_name = 2;
|
|
}
|
|
|
|
message DeleteTableResponse {
|
|
bool success = 1;
|
|
string message = 2;
|
|
}
|