暫無描述
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

query_json.go 1007B

123456789101112131415161718192021222324
  1. package functions
  2. import (
  3. "git.x2erp.com/qdy/go-base/ctx"
  4. "git.x2erp.com/qdy/go-base/types"
  5. "git.x2erp.com/qdy/go-db/factory/database"
  6. )
  7. // 执行查询,返回CSV数据格式。无参数查询
  8. func QueryToJSON(dbFactory *database.DBFactory, req types.QueryRequest, reqCtx *ctx.RequestContext) *types.QueryResult[[]map[string]interface{}] {
  9. return dbFactory.QueryToJSON(req.SQL, reqCtx)
  10. }
  11. // 执行查询,返回CSV数据格式。带参数名称进行查询
  12. func QueryParamNameToJSON(dbFactory *database.DBFactory, req types.QueryRequest, reqCtx *ctx.RequestContext) *types.QueryResult[[]map[string]interface{}] {
  13. return dbFactory.QueryParamsNameToJSON(req.SQL, req.Params, reqCtx)
  14. }
  15. // 执行查询,返回JSON数据格式。带占位参数进行查询
  16. func QueryPositionalToJSON(dbFactory *database.DBFactory, req types.QueryRequest, reqCtx *ctx.RequestContext) *types.QueryResult[[]map[string]interface{}] {
  17. return dbFactory.QueryPositionalToJSON(req.SQL, req.PositionalParams, reqCtx)
  18. }