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

import sqlalchemy
import sqlalchemy.ext.asyncio

from . import models


CREATE_HYPE_CRON_JOB_RUN_DETAILS = """-- name: create_hype_cron_job_run_details \\:exec
INSERT INTO hype_cron_job_run_details (jobid, command_type, command_params, status, schedule_time)
VALUES (:p1, :p2, :p3, :p4, :p5)
"""


@dataclasses.dataclass()
class CreateHypeCronJobRunDetailsParams:
    jobid: int
    command_type: Any
    command_params: Any
    status: Optional[Any]
    schedule_time: datetime.datetime


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

    def create_hype_cron_job_run_details(self, arg: CreateHypeCronJobRunDetailsParams) -> None:
        self._conn.execute(sqlalchemy.text(CREATE_HYPE_CRON_JOB_RUN_DETAILS), {
            "p1": arg.jobid,
            "p2": arg.command_type,
            "p3": arg.command_params,
            "p4": arg.status,
            "p5": arg.schedule_time,
        })


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

    async def create_hype_cron_job_run_details(self, arg: CreateHypeCronJobRunDetailsParams) -> None:
        await self._conn.execute(sqlalchemy.text(CREATE_HYPE_CRON_JOB_RUN_DETAILS), {
            "p1": arg.jobid,
            "p2": arg.command_type,
            "p3": arg.command_params,
            "p4": arg.status,
            "p5": arg.schedule_time,
        })
