from dataclasses import dataclass, field
from typing import Any, Dict, List


@dataclass(frozen=True)
class Eq:
    value: Any


@dataclass(frozen=True)
class Gt:
    value: Any


@dataclass(frozen=True)
class Gte:
    value: Any


@dataclass(frozen=True)
class Lt:
    value: Any


@dataclass(frozen=True)
class Lte:
    value: Any


@dataclass(frozen=True)
class In:
    values: List[Any]


@dataclass(frozen=True)
class Like:
    pattern: str


@dataclass(frozen=True)
class ILike:
    pattern: str


@dataclass(frozen=True)
class NotEq:
    value: Any


@dataclass(frozen=True)
class IsNull:
    """IS NULL operator — no value needed."""


@dataclass(frozen=True)
class IsNotNull:
    """IS NOT NULL operator — no value needed."""


@dataclass(frozen=True)
class RawExpr:
    """Raw SQL expression with optional bound parameters.

    Use when you need a SQL function or expression on the *value* side
    of a WHERE condition.  The *sql* string may contain ``:name``
    placeholders that reference keys in *params*.

    Example::

        RawExpr(">= UNIX_TIMESTAMP(DATE_SUB(NOW(), INTERVAL :days DAY))", {"days": 7})
    """
    sql: str
    params: Dict[str, Any] = field(default_factory=dict)
