"""Metadata types for GQLDB Python driver."""

from dataclasses import dataclass, field
from typing import Dict, Optional

from .enums import GraphType

@dataclass
class GraphInfo:
    """Information about a graph."""
    name: str
    graph_type: GraphType
    node_count: int
    edge_count: int
    description: str


@dataclass
class TransactionInfo:
    """Information about a transaction."""
    transaction_id: int
    session_id: int
    graph_name: str
    read_only: bool
    created_at: int
    duration_ms: int
    internal_tx_id: str


@dataclass
class ASTCacheStats:
    """AST cache statistics."""
    hits: int
    misses: int
    evictions: int
    entries: int
    hit_rate: float


@dataclass
class PlanCacheStats:
    """Plan cache statistics."""
    size: int
    capacity: int
    hits: int
    misses: int
    hit_rate: float


@dataclass
class CacheStats:
    """Combined cache statistics."""
    ast_stats: Optional[ASTCacheStats] = None
    plan_stats: Optional[PlanCacheStats] = None


@dataclass
class Statistics:
    """Database statistics."""
    node_count: int
    edge_count: int
    label_counts: Dict[str, int] = field(default_factory=dict)
    edge_label_counts: Dict[str, int] = field(default_factory=dict)
