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

import sqlalchemy
import sqlalchemy.ext.asyncio

from . import models


TRIM_TASK_STATS = """-- name: trim_task_stats \\:exec
DELETE FROM hyrex_stats_task_status_counts WHERE timepoint < :p1
"""


@dataclasses.dataclass()
class TrimTaskStatsParams:
    timepoint: datetime.datetime


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

    def trim_task_stats(self, arg: TrimTaskStatsParams) -> None:
        self._conn.execute(sqlalchemy.text(TRIM_TASK_STATS), {"p1": arg.timepoint})


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

    async def trim_task_stats(self, arg: TrimTaskStatsParams) -> None:
        await self._conn.execute(sqlalchemy.text(TRIM_TASK_STATS), {"p1": arg.timepoint})
