diff --git a/internal/manager/persistence/sqlc/query.sql b/internal/manager/persistence/sqlc/query.sql index 3318db5a..61583958 100644 --- a/internal/manager/persistence/sqlc/query.sql +++ b/internal/manager/persistence/sqlc/query.sql @@ -17,6 +17,10 @@ INSERT INTO jobs ( ) VALUES ( ?, ?, ?, ?, ?, ?, ?, ?, ?, ? ); +-- name: FetchJob :one +SELECT * FROM jobs +WHERE uuid = ? LIMIT 1; + -- name: DeleteJob :exec DELETE FROM jobs WHERE uuid = ?; @@ -26,10 +30,3 @@ UPDATE jobs SET delete_requested_at = @now WHERE id = sqlc.arg('job_id'); --- name: FetchTask :one -SELECT * FROM tasks -WHERE uuid = ? LIMIT 1; - --- name: FetchJob :one -SELECT * FROM jobs -WHERE uuid = ? LIMIT 1; diff --git a/internal/manager/persistence/sqlc/query.sql.go b/internal/manager/persistence/sqlc/query.sql.go index 10644a5b..1597aef2 100644 --- a/internal/manager/persistence/sqlc/query.sql.go +++ b/internal/manager/persistence/sqlc/query.sql.go @@ -95,32 +95,6 @@ func (q *Queries) FetchJob(ctx context.Context, uuid string) (Job, error) { return i, err } -const fetchTask = `-- name: FetchTask :one -SELECT id, created_at, updated_at, uuid, name, type, job_id, priority, status, worker_id, last_touched_at, commands, activity FROM tasks -WHERE uuid = ? LIMIT 1 -` - -func (q *Queries) FetchTask(ctx context.Context, uuid string) (Task, error) { - row := q.db.QueryRowContext(ctx, fetchTask, uuid) - var i Task - err := row.Scan( - &i.ID, - &i.CreatedAt, - &i.UpdatedAt, - &i.UUID, - &i.Name, - &i.Type, - &i.JobID, - &i.Priority, - &i.Status, - &i.WorkerID, - &i.LastTouchedAt, - &i.Commands, - &i.Activity, - ) - return i, err -} - const requestJobDeletion = `-- name: RequestJobDeletion :exec UPDATE jobs SET updated_at = ?1,