MCPcopy Index your code
hub / github.com/uber/aresdb / FetchAllEnums

Method FetchAllEnums

controller/client/controller.go:232–244  ·  view source on GitHub ↗

FetchAllEnums fetches all enums for given table and column

(tableName string, columnName string)

Source from the content-addressed store, hash-verified

230
231// FetchAllEnums fetches all enums for given table and column
232func (c *ControllerHTTPClient) FetchAllEnums(tableName string, columnName string) (enumDictReponse []string, err error) {
233 request, err := c.buildRequest(http.MethodGet, fmt.Sprintf("schema/%s/tables/%s/columns/%s/enum-cases", c.namespace, tableName, columnName), nil)
234 if err != nil {
235 return
236 }
237
238 err = c.getJSONResponse(request, &enumDictReponse)
239 if err != nil {
240 err = utils.StackError(err, "controller client error fetching schema for table: %s", tableName)
241 return
242 }
243 return
244}
245
246// ExtendEnumCases extends enum cases to given table column
247func (c *ControllerHTTPClient) ExtendEnumCases(tableName, columnName string, enumCases []string) (enumIDs []int, err error) {

Callers

nothing calls this directly

Calls 3

buildRequestMethod · 0.95
getJSONResponseMethod · 0.95
StackErrorFunction · 0.92

Tested by

no test coverage detected