Db service fixes and improvements: dot access, truncate table etc (#157)

This commit is contained in:
Janos Dobronszki
2021-06-14 12:32:38 +01:00
committed by GitHub
parent 917d4f2d3f
commit e4be18434c
6 changed files with 324 additions and 70 deletions

View File

@@ -10,21 +10,28 @@ service Db {
rpc Read(ReadRequest) returns (ReadResponse) {}
rpc Update(UpdateRequest) returns (UpdateResponse) {}
rpc Delete(DeleteRequest) returns (DeleteResponse) {}
rpc Truncate(TruncateRequest) returns (TruncateResponse) {}
}
message ReadRequest {
string table = 1;
// eg. 'age >= 18', 'age >= 18 and verified == true'
// comparison operators: '==', '!=', '<', '>', '<=', '>='
// logical operator: 'and'
string query = 2;
int32 offset = 3;
int32 limit = 4;
// Read by id. Equivalent to 'id == "your-id"'
string id = 2;
// Examples: 'age >= 18', 'age >= 18 and verified == true'
// Comparison operators: '==', '!=', '<', '>', '<=', '>='
// Logical operator: 'and'
// Dot access is supported, eg: 'user.age == 11'
// Accessing list elements is not supported yet.
string query = 3;
int32 offset = 4;
// Default limit is 25.
// Maximum limit is 1000. Anything higher will return an error.
int32 limit = 5;
// field name to order by
string orderBy = 5;
string orderBy = 6;
// 'asc' (default), 'desc'
string order = 6;
string order = 7;
}
message ReadResponse {
@@ -62,3 +69,11 @@ message DeleteRequest {
message DeleteResponse {
}
message TruncateRequest {
string table = 1;
}
message TruncateResponse {
string table = 1;
}