Merge pull request #884 from Vafilor/feat/filtering.updates

feat: updated workflow/workspace fields to allow some related field queries
This commit is contained in:
Rush Tehrani
2021-02-26 12:16:33 -08:00
committed by GitHub
2 changed files with 27 additions and 9 deletions

View File

@@ -2396,12 +2396,19 @@ func (c *Client) UpdateWorkflowExecutionMetrics(namespace, uid string, metrics M
// ListWorkflowExecutionsField loads all of the distinct field values for workflow executions
func (c *Client) ListWorkflowExecutionsField(namespace, field string) (value []string, err error) {
if field != "name" {
columnName := ""
switch field {
case "name":
columnName = "we.name"
break
case "templateName":
columnName = "wt.name"
break
default:
return nil, fmt.Errorf("unsupported field '%v'", field)
}
columnName := fmt.Sprintf("we.%v", field)
sb := sb.Select(columnName).
Distinct().
From("workflow_executions we").