mirror of
https://github.com/TeaOSLab/EdgeCommon.git
synced 2025-12-14 21:06:34 +08:00
提供数据库表相关管理API
This commit is contained in:
20
pkg/rpc/protos/model_db_table.proto
Normal file
20
pkg/rpc/protos/model_db_table.proto
Normal file
@@ -0,0 +1,20 @@
|
||||
syntax = "proto3";
|
||||
option go_package = "./pb";
|
||||
|
||||
package pb;
|
||||
|
||||
// 数据表信息
|
||||
message DBTable {
|
||||
string name = 1;
|
||||
string schema = 2;
|
||||
string type = 3;
|
||||
string engine = 4;
|
||||
int64 rows = 5;
|
||||
int64 dataLength = 6;
|
||||
int64 indexLength = 7;
|
||||
string comment = 8;
|
||||
string collation = 9;
|
||||
bool isBaseTable = 10;
|
||||
bool canClean = 11;
|
||||
bool canDelete = 12;
|
||||
}
|
||||
38
pkg/rpc/protos/service_db.proto
Normal file
38
pkg/rpc/protos/service_db.proto
Normal file
@@ -0,0 +1,38 @@
|
||||
syntax = "proto3";
|
||||
option go_package = "./pb";
|
||||
|
||||
package pb;
|
||||
|
||||
import "rpc_messages.proto";
|
||||
import "model_db_table.proto";
|
||||
|
||||
// 数据库相关服务
|
||||
service DBService {
|
||||
// 获取所有表信息
|
||||
rpc findAllDBTables (FindAllDBTablesRequest) returns (FindAllDBTablesResponse);
|
||||
|
||||
// 删除表
|
||||
rpc deleteDBTable (DeleteDBTableRequest) returns (RPCSuccess);
|
||||
|
||||
// 清空表
|
||||
rpc truncateDBTable (TruncateDBTableRequest) returns (RPCSuccess);
|
||||
}
|
||||
|
||||
// 获取所有表信息
|
||||
message FindAllDBTablesRequest {
|
||||
|
||||
}
|
||||
|
||||
message FindAllDBTablesResponse {
|
||||
repeated DBTable dbTables = 1;
|
||||
}
|
||||
|
||||
// 删除表
|
||||
message DeleteDBTableRequest {
|
||||
string dbTable = 1;
|
||||
}
|
||||
|
||||
// 清空表
|
||||
message TruncateDBTableRequest {
|
||||
string dbTable = 1;
|
||||
}
|
||||
Reference in New Issue
Block a user