dendrite/internal/cosmosdbapi/query.go
alexfca 1a5d7f2bb2
- Add SetUpdateTime() to all Update statements (#20)
- Refactor Updates to use a shared method
- Remove private setXX() methods

Co-authored-by: alexf@example.com <alexf@example.com>
2021-09-24 10:56:06 +10:00

21 lines
418 B
Go

package cosmosdbapi
import (
cosmosapi "github.com/vippsas/go-cosmosdb/cosmosapi"
)
func getQuery(qry string, params map[string]interface{}) cosmosapi.Query {
qryParams := []cosmosapi.QueryParam{}
for key, value := range params {
qryParam := cosmosapi.QueryParam{
Name: key,
Value: value,
}
qryParams = append(qryParams, qryParam)
}
return cosmosapi.Query{
Query: qry,
Params: qryParams,
}
}