Merged in fature/jobs (pull request #34)
Job Collector * createstructure * mostupdatevalidation * repocollectorupdate * updateoutline * updatevalidation * scriptupdate * cleanupdockerignore * update * collectorupdateapi
This commit is contained in:
@@ -124,6 +124,29 @@ func (q *Queries) GetQueryConfig(ctx context.Context, arg *GetQueryConfigParams)
|
||||
return &i, err
|
||||
}
|
||||
|
||||
const isQueryInDependencyTree = `-- name: IsQueryInDependencyTree :one
|
||||
SELECT EXISTS (
|
||||
SELECT 1 FROM queryActiveDependencies WHERE id = any($1) and requiredQueryId = $2 or $2 = any($1)
|
||||
)
|
||||
`
|
||||
|
||||
type IsQueryInDependencyTreeParams struct {
|
||||
ID []pgtype.UUID `db:"id"`
|
||||
Requiredqueryid pgtype.UUID `db:"requiredqueryid"`
|
||||
}
|
||||
|
||||
// IsQueryInDependencyTree
|
||||
//
|
||||
// SELECT EXISTS (
|
||||
// SELECT 1 FROM queryActiveDependencies WHERE id = any($1) and requiredQueryId = $2 or $2 = any($1)
|
||||
// )
|
||||
func (q *Queries) IsQueryInDependencyTree(ctx context.Context, arg *IsQueryInDependencyTreeParams) (bool, error) {
|
||||
row := q.db.QueryRow(ctx, isQueryInDependencyTree, arg.ID, arg.Requiredqueryid)
|
||||
var exists bool
|
||||
err := row.Scan(&exists)
|
||||
return exists, err
|
||||
}
|
||||
|
||||
const listQueries = `-- name: ListQueries :many
|
||||
SELECT id, type, activeversion, latestversion, config, requiredids FROM fullActiveQueries
|
||||
`
|
||||
|
||||
Reference in New Issue
Block a user