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

import sqlalchemy
import sqlalchemy.ext.asyncio

from . import models


SET_LOG_LINK = """-- name: set_log_link \\:exec
UPDATE hyrex_task_run
SET log_link = :p1
WHERE id = :p2
"""


@dataclasses.dataclass()
class SetLogLinkParams:
    log_link: Optional[str]
    id: uuid.UUID


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

    def set_log_link(self, arg: SetLogLinkParams) -> None:
        self._conn.execute(sqlalchemy.text(SET_LOG_LINK), {"p1": arg.log_link, "p2": arg.id})


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

    async def set_log_link(self, arg: SetLogLinkParams) -> None:
        await self._conn.execute(sqlalchemy.text(SET_LOG_LINK), {"p1": arg.log_link, "p2": arg.id})
