| 123456789101112131415161718192021222324252627 |
- # -*- coding: utf-8 -*-
- r"""标准仓读写接口(**组件接入点:TiDB community**)。
- 现在:仓库是本地 parquet 目录(`outputs/<场>/windscada/*.parquet`)。
- 目标:同一接口下新增 TiDB 实现(表 ↔ 仓映射、事务边界在这一层),算法层不受影响。
- P0 只立契约,**没有任何实现**(默认走现有本地实现,故零行为变化)。
- """
- from __future__ import annotations
- from abc import ABC, abstractmethod
- class Warehouse(ABC):
- """标准仓:按"表名"读写产物(与存储介质无关)。"""
- @abstractmethod
- def list_tables(self) -> list[str]: ...
- @abstractmethod
- def read_table(self, name: str): ...
- @abstractmethod
- def write_table(self, name: str, data, *, overwrite: bool = True) -> None: ...
- @abstractmethod
- def exists(self, name: str) -> bool: ...
|