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

import sqlalchemy
import sqlalchemy.ext.asyncio

from . import models


CREATE_RESULTS_TABLE = """-- name: create_results_table \\:exec
CREATE TABLE IF NOT EXISTS hyrex_task_result
(
    task_id    UUID PRIMARY KEY REFERENCES public.hyrex_task_run (id) ON DELETE CASCADE,
    result     JSON,
    created_at TIMESTAMP WITH TIME ZONE DEFAULT CURRENT_TIMESTAMP
)
"""


@dataclasses.dataclass()
class CreateResultsTableParams:

    pass

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

    def create_results_table(self, arg: CreateResultsTableParams) -> None:
        self._conn.execute(sqlalchemy.text(CREATE_RESULTS_TABLE))


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

    async def create_results_table(self, arg: CreateResultsTableParams) -> None:
        await self._conn.execute(sqlalchemy.text(CREATE_RESULTS_TABLE))
