cxppython 0.0.3__tar.gz → 0.1.0__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.
Files changed (24) hide show
  1. {cxppython-0.0.3 → cxppython-0.1.0}/PKG-INFO +1 -1
  2. {cxppython-0.0.3 → cxppython-0.1.0}/cxppython/utils/database/mysql.py +8 -4
  3. {cxppython-0.0.3 → cxppython-0.1.0}/cxppython.egg-info/PKG-INFO +1 -1
  4. {cxppython-0.0.3 → cxppython-0.1.0}/setup.py +1 -1
  5. {cxppython-0.0.3 → cxppython-0.1.0}/LICENSE +0 -0
  6. {cxppython-0.0.3 → cxppython-0.1.0}/README.md +0 -0
  7. {cxppython-0.0.3 → cxppython-0.1.0}/cxppython/__init__.py +0 -0
  8. {cxppython-0.0.3 → cxppython-0.1.0}/cxppython/core/__init__.py +0 -0
  9. {cxppython-0.0.3 → cxppython-0.1.0}/cxppython/core/config.py +0 -0
  10. {cxppython-0.0.3 → cxppython-0.1.0}/cxppython/main.py +0 -0
  11. {cxppython-0.0.3 → cxppython-0.1.0}/cxppython/utils/__init__.py +0 -0
  12. {cxppython-0.0.3 → cxppython-0.1.0}/cxppython/utils/btlogging/__init__.py +0 -0
  13. {cxppython-0.0.3 → cxppython-0.1.0}/cxppython/utils/btlogging/console.py +0 -0
  14. {cxppython-0.0.3 → cxppython-0.1.0}/cxppython/utils/btlogging/defines.py +0 -0
  15. {cxppython-0.0.3 → cxppython-0.1.0}/cxppython/utils/btlogging/format.py +0 -0
  16. {cxppython-0.0.3 → cxppython-0.1.0}/cxppython/utils/btlogging/helpers.py +0 -0
  17. {cxppython-0.0.3 → cxppython-0.1.0}/cxppython/utils/btlogging/loggingmachine.py +0 -0
  18. {cxppython-0.0.3 → cxppython-0.1.0}/cxppython/utils/database/__init__.py +0 -0
  19. {cxppython-0.0.3 → cxppython-0.1.0}/cxppython/utils/easy_imports.py +0 -0
  20. {cxppython-0.0.3 → cxppython-0.1.0}/cxppython.egg-info/SOURCES.txt +0 -0
  21. {cxppython-0.0.3 → cxppython-0.1.0}/cxppython.egg-info/dependency_links.txt +0 -0
  22. {cxppython-0.0.3 → cxppython-0.1.0}/cxppython.egg-info/requires.txt +0 -0
  23. {cxppython-0.0.3 → cxppython-0.1.0}/cxppython.egg-info/top_level.txt +0 -0
  24. {cxppython-0.0.3 → cxppython-0.1.0}/setup.cfg +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.2
2
2
  Name: cxppython
3
- Version: 0.0.3
3
+ Version: 0.1.0
4
4
  Summary: A python utils package
5
5
  Home-page: https://github.com/yourusername/my_package
6
6
  Author: cxp
@@ -27,9 +27,6 @@ class MysqlDB:
27
27
 
28
28
  @staticmethod
29
29
  def session() -> Session:
30
- # engine = DB.__instance.engine
31
- # session = sessionmaker(bind=engine)
32
- # return session()
33
30
  session = MysqlDB.__instance.session
34
31
  return session()
35
32
 
@@ -66,6 +63,7 @@ class MysqlDB:
66
63
  # 尝试建立连接
67
64
  with MysqlDB.instance().engine.connect() as connection:
68
65
  cc.logging.success("Database connection successful!")
66
+ connection.commit()
69
67
  return True
70
68
  except OperationalError as e:
71
69
  cc.logging.error(f"Failed to connect to the database: {e}")
@@ -96,7 +94,13 @@ class MysqlDB:
96
94
  stmt = insert(model).values(batch)
97
95
  if ignore_existing:
98
96
  stmt = stmt.prefix_with("IGNORE")
99
- session.execute(stmt)
97
+
98
+ try:
99
+ session.execute(stmt)
100
+ except Exception as e:
101
+ cc.logging.error(f"Batch insert failed at index {i}: {e}")
102
+ session.rollback()
103
+ raise
100
104
 
101
105
  if commit_per_batch:
102
106
  session.commit()
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.2
2
2
  Name: cxppython
3
- Version: 0.0.3
3
+ Version: 0.1.0
4
4
  Summary: A python utils package
5
5
  Home-page: https://github.com/yourusername/my_package
6
6
  Author: cxp
@@ -2,7 +2,7 @@ from setuptools import setup, find_packages
2
2
 
3
3
  setup(
4
4
  name="cxppython", # 包名
5
- version="0.0.3", # 版本号
5
+ version="0.1.0", # 版本号
6
6
  packages=find_packages(exclude=["tests", "tests.*"]), # 自动找到所有包
7
7
  description="A python utils package",
8
8
  long_description=open("README.md").read(),
File without changes
File without changes
File without changes
File without changes