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

import sqlalchemy
import sqlalchemy.ext.asyncio

from . import models


TRIGGER_EXECUTE_QUEUED_CRON_JOB = """-- name: trigger_execute_queued_cron_job \\:one
SELECT execute_queued_cron_job() AS result
"""


@dataclasses.dataclass()
class TriggerExecuteQueuedCronJobParams:

    pass

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

    def trigger_execute_queued_cron_job(self, arg: TriggerExecuteQueuedCronJobParams) -> Optional[str]:
        row = self._conn.execute(sqlalchemy.text(TRIGGER_EXECUTE_QUEUED_CRON_JOB)).first()
        if row is None:
            return None
        return row[0]


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

    async def trigger_execute_queued_cron_job(self, arg: TriggerExecuteQueuedCronJobParams) -> Optional[str]:
        row = (await self._conn.execute(sqlalchemy.text(TRIGGER_EXECUTE_QUEUED_CRON_JOB))).first()
        if row is None:
            return None
        return row[0]
