grpc endpoint showing database schema for the frontend, now working
This commit is contained in:
@@ -14,8 +14,10 @@ service Adresar {
|
||||
rpc DeleteAdresar (DeleteAdresarRequest) returns (DeleteAdresarResponse);
|
||||
rpc GetAdresarCount (Empty) returns (CountResponse); // New endpoint
|
||||
rpc GetAdresarByPosition (PositionRequest) returns (AdresarResponse); // New endpoint
|
||||
rpc GetTableStructure (Empty) returns (TableStructureResponse); // New endpoint for table structure
|
||||
}
|
||||
|
||||
// Existing messages
|
||||
message GetAdresarRequest {
|
||||
int64 id = 1; // The ID of the Adresar entry to retrieve
|
||||
}
|
||||
@@ -102,3 +104,15 @@ message CountResponse {
|
||||
message PositionRequest {
|
||||
int64 position = 1; // Request with the position of the item to retrieve
|
||||
}
|
||||
|
||||
// New messages for the table structure endpoint
|
||||
message TableStructureResponse {
|
||||
repeated TableColumn columns = 1; // List of columns in the table
|
||||
}
|
||||
|
||||
message TableColumn {
|
||||
string name = 1; // Name of the column
|
||||
string data_type = 2; // Data type of the column (e.g., TEXT, INT, etc.)
|
||||
bool is_nullable = 3; // Whether the column allows NULL values
|
||||
bool is_primary_key = 4; // Whether the column is a primary key
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user