(hash, id string)
| 42 | } |
| 43 | |
| 44 | func (api *API) GetWorkflow(hash, id string) (*config.Workflow, error) { |
| 45 | var workflowText []byte |
| 46 | err := api.db.QueryRow(`select text from workflows where config_hash = $1 AND id = $2`, hash, id).Scan(&workflowText) |
| 47 | if err != nil { |
| 48 | return nil, err |
| 49 | } |
| 50 | workflow := &config.Workflow{} |
| 51 | err = workflow.Parse(workflowText) |
| 52 | if err != nil { |
| 53 | return nil, err |
| 54 | } |
| 55 | return workflow, nil |
| 56 | } |
| 57 | |
| 58 | func (api *API) GetWorkflows(hash string) (map[string]config.Workflow, error) { |
| 59 | rows, err := api.db.Query("SELECT text FROM workflows WHERE config_hash = $1", hash) |
no test coverage detected