在准备环境前提交次全部更改。

This commit is contained in:
Neo
2026-02-19 08:35:13 +08:00
parent ded6dfb9d8
commit 4eac07da47
1387 changed files with 6107191 additions and 33002 deletions

View File

@@ -0,0 +1,23 @@
# -*- coding: utf-8 -*-
"""数据加载器基类"""
import logging
class BaseLoader:
"""数据加载器基类"""
def __init__(self, db_ops, logger=None):
self.db = db_ops
self.logger = logger or logging.getLogger(self.__class__.__name__)
def upsert(self, records: list) -> tuple:
"""
执行 UPSERT 操作
返回: (inserted_count, updated_count, skipped_count)
"""
raise NotImplementedError("子类需实现 upsert 方法")
def _batch_size(self) -> int:
"""批次大小"""
return 1000