# Code generated by sqlc. DO NOT EDIT.
# versions:
#   sqlc v1.29.0
# source: update_hype_cron_job_confirmed_until.sql
import dataclasses
import datetime
from typing import Optional

import sqlalchemy
import sqlalchemy.ext.asyncio

from . import models


UPDATE_HYPE_CRON_JOB_CONFIRMED_UNTIL = """-- name: update_hype_cron_job_confirmed_until \\:exec
UPDATE hype_cron_job
SET scheduled_jobs_confirmed_until = :p2
WHERE jobid = :p1
"""


@dataclasses.dataclass()
class UpdateHypeCronJobConfirmedUntilParams:
    jobid: int
    scheduled_jobs_confirmed_until: Optional[datetime.datetime]


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

    def update_hype_cron_job_confirmed_until(self, arg: UpdateHypeCronJobConfirmedUntilParams) -> None:
        self._conn.execute(sqlalchemy.text(UPDATE_HYPE_CRON_JOB_CONFIRMED_UNTIL), {"p1": arg.jobid, "p2": arg.scheduled_jobs_confirmed_until})


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

    async def update_hype_cron_job_confirmed_until(self, arg: UpdateHypeCronJobConfirmedUntilParams) -> None:
        await self._conn.execute(sqlalchemy.text(UPDATE_HYPE_CRON_JOB_CONFIRMED_UNTIL), {"p1": arg.jobid, "p2": arg.scheduled_jobs_confirmed_until})
