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

import sqlalchemy
import sqlalchemy.ext.asyncio

from . import models


CREATE_WORKFLOW_TABLE = """-- name: create_workflow_table \\:exec
CREATE TABLE IF NOT EXISTS hyrex_workflow
(
    workflow_name TEXT NOT NULL PRIMARY KEY,
    cron_expr     TEXT,
    source_code   TEXT,
    dag_structure JSONB,
    last_updated  TIMESTAMP WITH TIME ZONE DEFAULT CURRENT_TIMESTAMP
)
"""


@dataclasses.dataclass()
class CreateWorkflowTableParams:

    pass

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

    def create_workflow_table(self, arg: CreateWorkflowTableParams) -> None:
        self._conn.execute(sqlalchemy.text(CREATE_WORKFLOW_TABLE))


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

    async def create_workflow_table(self, arg: CreateWorkflowTableParams) -> None:
        await self._conn.execute(sqlalchemy.text(CREATE_WORKFLOW_TABLE))
