mdbq 4.2.6__tar.gz → 4.2.7__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Potentially problematic release.
This version of mdbq might be problematic. Click here for more details.
- {mdbq-4.2.6 → mdbq-4.2.7}/PKG-INFO +1 -1
- mdbq-4.2.7/mdbq/__version__.py +1 -0
- {mdbq-4.2.6 → mdbq-4.2.7}/mdbq/mysql/uploader.py +11 -13
- {mdbq-4.2.6 → mdbq-4.2.7}/mdbq.egg-info/PKG-INFO +1 -1
- mdbq-4.2.6/mdbq/__version__.py +0 -1
- {mdbq-4.2.6 → mdbq-4.2.7}/README.txt +0 -0
- {mdbq-4.2.6 → mdbq-4.2.7}/mdbq/__init__.py +0 -0
- {mdbq-4.2.6 → mdbq-4.2.7}/mdbq/auth/__init__.py +0 -0
- {mdbq-4.2.6 → mdbq-4.2.7}/mdbq/auth/auth_backend.py +0 -0
- {mdbq-4.2.6 → mdbq-4.2.7}/mdbq/auth/crypto.py +0 -0
- {mdbq-4.2.6 → mdbq-4.2.7}/mdbq/auth/rate_limiter.py +0 -0
- {mdbq-4.2.6 → mdbq-4.2.7}/mdbq/js/__init__.py +0 -0
- {mdbq-4.2.6 → mdbq-4.2.7}/mdbq/js/jc.py +0 -0
- {mdbq-4.2.6 → mdbq-4.2.7}/mdbq/log/__init__.py +0 -0
- {mdbq-4.2.6 → mdbq-4.2.7}/mdbq/log/mylogger.py +0 -0
- {mdbq-4.2.6 → mdbq-4.2.7}/mdbq/myconf/__init__.py +0 -0
- {mdbq-4.2.6 → mdbq-4.2.7}/mdbq/myconf/myconf.py +0 -0
- {mdbq-4.2.6 → mdbq-4.2.7}/mdbq/mysql/__init__.py +0 -0
- {mdbq-4.2.6 → mdbq-4.2.7}/mdbq/mysql/deduplicator.py +0 -0
- {mdbq-4.2.6 → mdbq-4.2.7}/mdbq/mysql/mysql.py +0 -0
- {mdbq-4.2.6 → mdbq-4.2.7}/mdbq/mysql/s_query.py +0 -0
- {mdbq-4.2.6 → mdbq-4.2.7}/mdbq/mysql/unique_.py +0 -0
- {mdbq-4.2.6 → mdbq-4.2.7}/mdbq/other/__init__.py +0 -0
- {mdbq-4.2.6 → mdbq-4.2.7}/mdbq/other/download_sku_picture.py +0 -0
- {mdbq-4.2.6 → mdbq-4.2.7}/mdbq/other/error_handler.py +0 -0
- {mdbq-4.2.6 → mdbq-4.2.7}/mdbq/other/otk.py +0 -0
- {mdbq-4.2.6 → mdbq-4.2.7}/mdbq/other/pov_city.py +0 -0
- {mdbq-4.2.6 → mdbq-4.2.7}/mdbq/other/ua_sj.py +0 -0
- {mdbq-4.2.6 → mdbq-4.2.7}/mdbq/pbix/__init__.py +0 -0
- {mdbq-4.2.6 → mdbq-4.2.7}/mdbq/pbix/pbix_refresh.py +0 -0
- {mdbq-4.2.6 → mdbq-4.2.7}/mdbq/pbix/refresh_all.py +0 -0
- {mdbq-4.2.6 → mdbq-4.2.7}/mdbq/redis/__init__.py +0 -0
- {mdbq-4.2.6 → mdbq-4.2.7}/mdbq/redis/getredis.py +0 -0
- {mdbq-4.2.6 → mdbq-4.2.7}/mdbq/redis/redis_cache.py +0 -0
- {mdbq-4.2.6 → mdbq-4.2.7}/mdbq/route/__init__.py +0 -0
- {mdbq-4.2.6 → mdbq-4.2.7}/mdbq/route/analytics.py +0 -0
- {mdbq-4.2.6 → mdbq-4.2.7}/mdbq/route/monitor.py +0 -0
- {mdbq-4.2.6 → mdbq-4.2.7}/mdbq/route/routes.py +0 -0
- {mdbq-4.2.6 → mdbq-4.2.7}/mdbq/selenium/__init__.py +0 -0
- {mdbq-4.2.6 → mdbq-4.2.7}/mdbq/selenium/get_driver.py +0 -0
- {mdbq-4.2.6 → mdbq-4.2.7}/mdbq/spider/__init__.py +0 -0
- {mdbq-4.2.6 → mdbq-4.2.7}/mdbq.egg-info/SOURCES.txt +0 -0
- {mdbq-4.2.6 → mdbq-4.2.7}/mdbq.egg-info/dependency_links.txt +0 -0
- {mdbq-4.2.6 → mdbq-4.2.7}/mdbq.egg-info/top_level.txt +0 -0
- {mdbq-4.2.6 → mdbq-4.2.7}/setup.cfg +0 -0
- {mdbq-4.2.6 → mdbq-4.2.7}/setup.py +0 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
VERSION = '4.2.7'
|
|
@@ -770,8 +770,7 @@ class TableManager:
|
|
|
770
770
|
except Exception as e:
|
|
771
771
|
raise ValueError(f"无效的日期值: {date_value}, 错误: {str(e)}")
|
|
772
772
|
|
|
773
|
-
|
|
774
|
-
def _sanitize_identifier(identifier: str) -> str:
|
|
773
|
+
def _sanitize_identifier(self, identifier: str) -> str:
|
|
775
774
|
"""清理标识符"""
|
|
776
775
|
if not identifier or not isinstance(identifier, str):
|
|
777
776
|
raise ValueError(f"无效的标识符: {identifier}")
|
|
@@ -783,18 +782,16 @@ class TableManager:
|
|
|
783
782
|
if not cleaned:
|
|
784
783
|
raise ValueError(f"标识符清理后为空: {identifier}")
|
|
785
784
|
|
|
786
|
-
# 检查MySQL关键字
|
|
787
|
-
mysql_keywords = {
|
|
788
|
-
|
|
789
|
-
|
|
790
|
-
}
|
|
785
|
+
# # 检查MySQL关键字
|
|
786
|
+
# mysql_keywords = {
|
|
787
|
+
# 'select', 'insert', 'update', 'delete', 'from', 'where', 'and', 'or',
|
|
788
|
+
# 'not', 'like', 'in', 'is', 'null', 'true', 'false', 'between'
|
|
789
|
+
# }
|
|
791
790
|
|
|
792
791
|
if len(cleaned) > 64:
|
|
793
792
|
cleaned = cleaned[:64]
|
|
794
793
|
|
|
795
|
-
|
|
796
|
-
return f"`{cleaned}`"
|
|
797
|
-
|
|
794
|
+
# 不在这里添加反引号,让调用者决定是否需要
|
|
798
795
|
return cleaned
|
|
799
796
|
|
|
800
797
|
|
|
@@ -918,8 +915,9 @@ class DataProcessor:
|
|
|
918
915
|
class DataInserter:
|
|
919
916
|
"""数据插入器"""
|
|
920
917
|
|
|
921
|
-
def __init__(self, connection_manager: DatabaseConnectionManager):
|
|
918
|
+
def __init__(self, connection_manager: DatabaseConnectionManager, table_manager: TableManager = None):
|
|
922
919
|
self.conn_mgr = connection_manager
|
|
920
|
+
self.table_mgr = table_manager
|
|
923
921
|
|
|
924
922
|
def insert_data(self, db_name: str, table_name: str, data: List[Dict],
|
|
925
923
|
set_typ: Dict[str, str], update_on_duplicate: bool = False) -> Tuple[int, int, int]:
|
|
@@ -929,7 +927,7 @@ class DataInserter:
|
|
|
929
927
|
|
|
930
928
|
# 准备SQL语句(排除系统列)
|
|
931
929
|
columns = [col for col in set_typ.keys() if col.lower() not in ['id', 'create_at', 'update_at']]
|
|
932
|
-
safe_columns = [
|
|
930
|
+
safe_columns = [self.table_mgr._sanitize_identifier(col) if self.table_mgr else col for col in columns]
|
|
933
931
|
placeholders = ','.join(['%s'] * len(columns))
|
|
934
932
|
|
|
935
933
|
sql = f"""
|
|
@@ -1098,7 +1096,7 @@ class MySQLUploader:
|
|
|
1098
1096
|
# 初始化组件
|
|
1099
1097
|
self.conn_mgr = DatabaseConnectionManager(self.config)
|
|
1100
1098
|
self.table_mgr = TableManager(self.conn_mgr, collation)
|
|
1101
|
-
self.data_inserter = DataInserter(self.conn_mgr)
|
|
1099
|
+
self.data_inserter = DataInserter(self.conn_mgr, self.table_mgr)
|
|
1102
1100
|
|
|
1103
1101
|
@retry_on_failure(max_retries=3)
|
|
1104
1102
|
def upload_data(self, db_name: str, table_name: str,
|
mdbq-4.2.6/mdbq/__version__.py
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
VERSION = '4.2.6'
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|