Files
komp_ac/common/proto/table_definition.proto
2025-05-23 13:34:39 +02:00

60 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 {
int64 id = 1;
string name = 2;
repeated string depends_on = 3;
}
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;
}