This method ended up being equal to the one mentioned.
This commit is contained in:
Aleksandr Melnikov
2020-05-22 15:42:25 -07:00
parent f4743d3790
commit f555584fc8

View File

@@ -285,7 +285,7 @@ func (c *Client) CreateCronWorkflow(namespace string, cronWorkflow *CronWorkflow
func (c *Client) GetCronWorkflow(namespace, uid string) (cronWorkflow *CronWorkflow, err error) {
cronWorkflow = &CronWorkflow{}
err = c.cronWorkflowSelectBuilderNamespaceName(namespace, uid).
err = c.cronWorkflowSelectBuilderNoColumns(namespace, uid).
RunWith(c.DB).
QueryRow().
Scan(cronWorkflow)
@@ -566,21 +566,6 @@ func (c *Client) cronWorkflowSelectBuilder(namespace string, workflowTemplateUid
return sb
}
func (c *Client) cronWorkflowSelectBuilderNamespaceName(namespace string, uid string) sq.SelectBuilder {
sb := sb.Select("cw.id", "cw.created_at", "cw.uid", "cw.name", "cw.workflow_template_version_id", "cw.namespace").
Columns("cw.manifest", "wtv.version").
From("cron_workflows cw").
Join("workflow_template_versions wtv ON wtv.id = cw.workflow_template_version_id").
Join("workflow_templates wt ON wt.id = wtv.workflow_template_id").
Where(sq.Eq{
"cw.namespace": namespace,
"cw.name": uid,
"cw.is_archived": false,
})
return sb
}
func (c *Client) cronWorkflowSelectBuilderNoColumns(namespace string, workflowTemplateUid string) sq.SelectBuilder {
sb := sb.Select().
From("cron_workflows cw").