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

import sqlalchemy
import sqlalchemy.ext.asyncio

from . import models


CREATE_HYPE_CRON_JOB_TABLE = """-- name: create_hype_cron_job_table \\:exec
CREATE TABLE IF NOT EXISTS hype_cron_job
(
    jobid                          bigserial PRIMARY KEY,
    schedule                       text,
    command_type                   hype_command_type NOT NULL,
    command_params                 JSONB   NOT NULL,
    active                         boolean NOT NULL DEFAULT true,
    jobname                        text    NOT NULL,
    activated_at                   timestamptz      default now(),
    scheduled_jobs_confirmed_until timestamptz      default now(),
    should_backfill                boolean default true,
    UNIQUE (jobname)
)
"""


@dataclasses.dataclass()
class CreateHypeCronJobTableParams:

    pass

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

    def create_hype_cron_job_table(self, arg: CreateHypeCronJobTableParams) -> None:
        self._conn.execute(sqlalchemy.text(CREATE_HYPE_CRON_JOB_TABLE))


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

    async def create_hype_cron_job_table(self, arg: CreateHypeCronJobTableParams) -> None:
        await self._conn.execute(sqlalchemy.text(CREATE_HYPE_CRON_JOB_TABLE))
