MCPcopy Create free account
hub / github.com/CovenantSQL/CovenantSQL / GetProjectUsers

Function GetProjectUsers

cmd/cql-proxy/model/project_user.go:143–161  ·  view source on GitHub ↗

GetProjectUsers batch fetch user info by ids.

(db *gorp.DbMap, id []int64)

Source from the content-addressed store, hash-verified

141
142// GetProjectUsers batch fetch user info by ids.
143func GetProjectUsers(db *gorp.DbMap, id []int64) (users []*ProjectUser, err error) {
144 if len(id) == 0 {
145 return
146 }
147
148 var args []interface{}
149
150 for _, v := range id {
151 args = append(args, v)
152 }
153
154 _, err = db.Select(&users, `SELECT * FROM "____user" WHERE "id" IN (`+
155 strings.Repeat("?,", len(id)-1)+`?)`, args...)
156 if err != nil {
157 err = errors.Wrapf(err, "get project users failed")
158 }
159
160 return
161}
162
163// GetProjectUserList provide search and paging of project user list.
164func GetProjectUserList(db *gorp.DbMap, searchTerm string, showOnlyEnabled bool, offset int64, limit int64) (

Callers 1

batchQueryProjectUserFunction · 0.92

Calls

no outgoing calls

Tested by

no test coverage detected