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

Function GetProjectTableConfig

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

GetProjectTableConfig returns specified table config of project.

(db *gorp.DbMap, tableName string)

Source from the content-addressed store, hash-verified

165
166// GetProjectTableConfig returns specified table config of project.
167func GetProjectTableConfig(db *gorp.DbMap, tableName string) (p *ProjectConfig, pc *ProjectTableConfig, err error) {
168 err = db.SelectOne(&p, `SELECT * FROM "____config" WHERE "type" = ? AND "key" = ? LIMIT 1`,
169 ProjectConfigTable, tableName)
170 if err != nil {
171 err = errors.Wrapf(err, "get project table config failed")
172 return
173 }
174
175 err = json.Unmarshal(p.RawValue, &pc)
176 if err == nil {
177 p.Value = pc
178 } else {
179 err = errors.Wrapf(err, "resolve project table config data failed")
180 }
181
182 return
183}
184
185// GetProjectTablesName returns all table names of project.
186func GetProjectTablesName(db *gorp.DbMap) (tables []string, err error) {

Callers 4

getProjectTableDetailFunction · 0.92
addFieldsToProjectTableFunction · 0.92
dropProjectTableFunction · 0.92
buildExecuteContextFunction · 0.92

Calls 1

UnmarshalMethod · 0.80

Tested by

no test coverage detected