(tableName, columnName string, enumCases []string)
| 347 | } |
| 348 | |
| 349 | func (hf *httpSchemaFetcher) ExtendEnumCases(tableName, columnName string, enumCases []string) ([]int, error) { |
| 350 | if len(enumCases) == 0 { |
| 351 | return []int{}, nil |
| 352 | } |
| 353 | |
| 354 | enumCasesRequest := enumCasesWrapper{ |
| 355 | EnumCases: enumCases, |
| 356 | } |
| 357 | |
| 358 | enumCasesBytes, err := json.Marshal(enumCasesRequest) |
| 359 | if err != nil { |
| 360 | return nil, utils.StackError(err, "Failed to marshal enum cases") |
| 361 | } |
| 362 | |
| 363 | var enumIDs []int |
| 364 | resp, err := hf.httpClient.Post(hf.enumDictPath(tableName, columnName), applicationJSONHeader, bytes.NewReader(enumCasesBytes)) |
| 365 | err = hf.readJSONResponse(resp, err, &enumIDs) |
| 366 | if err != nil { |
| 367 | return nil, err |
| 368 | } |
| 369 | return enumIDs, nil |
| 370 | } |
| 371 | |
| 372 | func (hf *httpSchemaFetcher) FetchSchema(tableName string) (*metaCom.Table, error) { |
| 373 | var table metaCom.Table |
nothing calls this directly
no test coverage detected