MCPcopy Index your code
hub / github.com/CovenantSQL/CovenantSQL / GetProjectMiscConfig

Function GetProjectMiscConfig

cmd/cql-proxy/model/project_config.go:209–225  ·  view source on GitHub ↗

GetProjectMiscConfig returns misc config object of project.

(db *gorp.DbMap)

Source from the content-addressed store, hash-verified

207
208// GetProjectMiscConfig returns misc config object of project.
209func GetProjectMiscConfig(db *gorp.DbMap) (p *ProjectConfig, pc *ProjectMiscConfig, err error) {
210 err = db.SelectOne(&p, `SELECT * FROM "____config" WHERE "type" = ? LIMIT 1`,
211 ProjectConfigMisc)
212 if err != nil {
213 err = errors.Wrapf(err, "get project misc config failed")
214 return
215 }
216
217 err = json.Unmarshal(p.RawValue, &pc)
218 if err == nil {
219 p.Value = pc
220 } else {
221 err = errors.Wrapf(err, "resolve project misc config failed")
222 }
223
224 return
225}
226
227// GetProjectGroupConfig returns group config object of project.
228func GetProjectGroupConfig(db *gorp.DbMap) (p *ProjectConfig, gc *ProjectGroupConfig, err error) {

Callers 5

userOAuthAuthorizeFunction · 0.92
handleUserOAuthCallbackFunction · 0.92
userSessionInjectFunction · 0.92
updateProjectMiscConfigFunction · 0.92
buildExecuteContextFunction · 0.92

Calls 1

UnmarshalMethod · 0.80

Tested by

no test coverage detected