# Code generated by sqlc. DO NOT EDIT.
# versions:
#   sqlc v1.29.0
# source: turn_off_cron_for_task.sql
import dataclasses

import sqlalchemy
import sqlalchemy.ext.asyncio

from . import models


TURN_OFF_CRON_FOR_TASK = """-- name: turn_off_cron_for_task \\:exec
UPDATE hyrex_cron_job
SET active   = false,
    schedule = NULL
WHERE jobname = :p1
  AND job_source = 'TASK'
"""


@dataclasses.dataclass()
class TurnOffCronForTaskParams:
    jobname: str


class Querier:
    def __init__(self, conn: sqlalchemy.engine.Connection):
        self._conn = conn

    def turn_off_cron_for_task(self, arg: TurnOffCronForTaskParams) -> None:
        self._conn.execute(sqlalchemy.text(TURN_OFF_CRON_FOR_TASK), {"p1": arg.jobname})


class AsyncQuerier:
    def __init__(self, conn: sqlalchemy.ext.asyncio.AsyncConnection):
        self._conn = conn

    async def turn_off_cron_for_task(self, arg: TurnOffCronForTaskParams) -> None:
        await self._conn.execute(sqlalchemy.text(TURN_OFF_CRON_FOR_TASK), {"p1": arg.jobname})
