extract common create and updatelogic

This commit is contained in:
Michael McGuinness
2025-01-03 16:00:36 +00:00
parent 9f505dd94c
commit 0447ec4c4b
9 changed files with 24 additions and 72 deletions
-11
View File
@@ -77,17 +77,6 @@ func (q *Queries) GetQueryConfig(ctx context.Context, arg GetQueryConfigParams)
return i, err
}
const getQueryType = `-- name: GetQueryType :one
SELECT type FROM queries where id = $1
`
func (q *Queries) GetQueryType(ctx context.Context, id pgtype.UUID) (Querytype, error) {
row := q.db.QueryRow(ctx, getQueryType, id)
var type_ Querytype
err := row.Scan(&type_)
return type_, err
}
const isQueryDeprecated = `-- name: IsQueryDeprecated :one
SELECT EXISTS (
SELECT 1 FROM queryDeprecations where queryId = $1 and removedAt is not null