grpc endpoint showing database schema for the frontend, now working

This commit is contained in:
filipriec
2025-02-21 01:55:33 +01:00
parent d105d06230
commit 5d9fffce13
5 changed files with 144 additions and 1 deletions

View File

@@ -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
}