mirror of
https://github.com/kevin-DL/services.git
synced 2026-01-11 19:04:35 +00:00
User service: move to db (#146)
This commit is contained in:
@@ -33,7 +33,7 @@
|
||||
"records": [{
|
||||
"id": "1",
|
||||
"name": "Jane",
|
||||
"age": 42,
|
||||
"age": 43,
|
||||
"isActive":true
|
||||
}]
|
||||
}
|
||||
|
||||
@@ -204,6 +204,7 @@ func (e *Db) Read(ctx context.Context, req *db.ReadRequest, rsp *db.ReadResponse
|
||||
}
|
||||
db = db.Table(tableName)
|
||||
for _, query := range queries {
|
||||
logger.Infof("Query field: %v, op: %v, type: %v", query.Field, query.Op, query.Value)
|
||||
typ := "text"
|
||||
switch query.Value.(type) {
|
||||
case int64:
|
||||
|
||||
@@ -92,6 +92,16 @@ func TestParsing(t *testing.T) {
|
||||
},
|
||||
},
|
||||
},
|
||||
tCase{
|
||||
Q: `id == '795c1e56-d1f3-495d-b9cb-d84a56ffb39c'`,
|
||||
E: []Query{
|
||||
Query{
|
||||
Field: "id",
|
||||
Value: "795c1e56-d1f3-495d-b9cb-d84a56ffb39c",
|
||||
Op: itemEquals,
|
||||
},
|
||||
},
|
||||
},
|
||||
tCase{
|
||||
Q: `a == 12 and name != 'nandos'`,
|
||||
E: []Query{
|
||||
|
||||
Reference in New Issue
Block a user