database-wrapper 0.1.37__py3-none-any.whl → 0.1.40__py3-none-any.whl

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.
@@ -3,7 +3,7 @@ from typing import Any
3
3
  CONFIG: dict[str, Any] = {
4
4
  # These are supposed to be set automatically by a git pre-compile script
5
5
  # They are one git commit hash behind, if used automatically
6
- "git_commit_hash": "6e44a2436719d47a75251397bc59a7abdc77bc86",
7
- "git_commit_date": "11.11.2024 22:12",
8
- "app_version": "0.1.37",
6
+ "git_commit_hash": "b2c4127c61167d1bb1e6ccdc23cf0b333f2f86a7",
7
+ "git_commit_date": "15.11.2024 00:32",
8
+ "app_version": "0.1.40",
9
9
  }
@@ -43,7 +43,7 @@ class DBWrapperMixin:
43
43
  # Meta methods
44
44
  def __init__(
45
45
  self,
46
- db: DatabaseBackend,
46
+ db: Any = None,
47
47
  dbConn: Any = None,
48
48
  logger: logging.Logger | None = None,
49
49
  ):
@@ -76,6 +76,37 @@ class DBWrapperMixin:
76
76
  if hasattr(self, "dbConn") and self.dbConn:
77
77
  del self.dbConn
78
78
 
79
+ ###############
80
+ ### Setters ###
81
+ ###############
82
+
83
+ def setDb(self, db: Any) -> None:
84
+ """
85
+ Updates the database backend object.
86
+
87
+ Args:
88
+ db (Any): The new database backend object.
89
+ """
90
+ if db is None:
91
+ del self.db
92
+ return
93
+
94
+ self.db = db
95
+
96
+ def setDbConn(self, dbConn: Any) -> None:
97
+ """
98
+ Updates the database connection object.
99
+
100
+ Args:
101
+ dbConn (Any): The new database connection object.
102
+ """
103
+
104
+ if dbConn is None:
105
+ del self.dbConn
106
+ return
107
+
108
+ self.dbConn = dbConn
109
+
79
110
  ######################
80
111
  ### Helper methods ###
81
112
  ######################
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: database_wrapper
3
- Version: 0.1.37
3
+ Version: 0.1.40
4
4
  Summary: A Different Approach to Database Wrappers in Python
5
5
  Author-email: Gints Murans <gm@gm.lv>
6
6
  License: GNU General Public License v3.0 (GPL-3.0)
@@ -46,13 +46,13 @@ Requires-Dist: psycopg[pool] >=3.2.0 ; extra == 'dev'
46
46
  Requires-Dist: mysqlclient >=2.2.2 ; extra == 'dev'
47
47
  Requires-Dist: pymssql >=2.2.10 ; extra == 'dev'
48
48
  Provides-Extra: mssql
49
- Requires-Dist: database-wrapper-mssql ==0.1.37 ; extra == 'mssql'
49
+ Requires-Dist: database-wrapper-mssql ==0.1.40 ; extra == 'mssql'
50
50
  Provides-Extra: mysql
51
- Requires-Dist: database-wrapper-mysql ==0.1.37 ; extra == 'mysql'
51
+ Requires-Dist: database-wrapper-mysql ==0.1.40 ; extra == 'mysql'
52
52
  Provides-Extra: pgsql
53
- Requires-Dist: database-wrapper-pgsql ==0.1.37 ; extra == 'pgsql'
53
+ Requires-Dist: database-wrapper-pgsql ==0.1.40 ; extra == 'pgsql'
54
54
  Provides-Extra: sqlite
55
- Requires-Dist: database-wrapper-sqlite ==0.1.37 ; extra == 'sqlite'
55
+ Requires-Dist: database-wrapper-sqlite ==0.1.40 ; extra == 'sqlite'
56
56
 
57
57
  # database_wrapper
58
58
 
@@ -1,16 +1,16 @@
1
1
  database_wrapper/__init__.py,sha256=amoShlhRpOhrFbGeKbdq47H5omcVRd4xWG-RUX7bdIk,830
2
2
  database_wrapper/common.py,sha256=fsxe28o_4xCrotPbB274dmzQ9rOyes0sBtcHog-9RVc,258
3
- database_wrapper/config.py,sha256=6Xp2QYt44wT0t1bY2-J2xx4LdExLN2Tt3pLDwBvNDxA,334
3
+ database_wrapper/config.py,sha256=iAQHUB4QSKlzwcGSsEw-M3hRIIJmGKrN_W2mlE5annU,334
4
4
  database_wrapper/db_backend.py,sha256=iQd1yVsLumutfoOmWY-XAAiLg00_I-IueOv_RtO_7ew,5068
5
5
  database_wrapper/db_data_model.py,sha256=njef4LR7XQcTdob961t1DQ7q3i2dzfVrFyuAtD3YYwQ,12181
6
6
  database_wrapper/db_wrapper.py,sha256=9RuixREftA52pL24qYBJSmaZ2_4a9dDSUS4MUhPSrlE,17874
7
7
  database_wrapper/db_wrapper_async.py,sha256=0fFqrV8fbFOaloXOg1qQVu_xA3RRJVrrJ6rQWti1aek,18318
8
- database_wrapper/db_wrapper_mixin.py,sha256=YXMLPehomcG3NNE2NEcHFNuAgCF4IvAeY6YPFJbY7Ho,9987
8
+ database_wrapper/db_wrapper_mixin.py,sha256=1IvfzeLX6b90jPKF4dnEFLCIBbOYFlgy2opUQaYxvYM,10610
9
9
  database_wrapper/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
10
10
  database_wrapper/utils/__init__.py,sha256=mnewmY38-837VAh4f42hvpMUBVUjOLoMtIfdZBxbkg0,134
11
11
  database_wrapper/utils/dataclass_addons.py,sha256=5_ZAj8h-4RtimEM-b9lo6TXi4qYVTf7KIjTtu0jzAS4,762
12
12
  database_wrapper/utils/timer.py,sha256=ZJpVMsQ7oHHgyuqMOxVee1fZD78kcDrP4c8gHug3xGU,8927
13
- database_wrapper-0.1.37.dist-info/METADATA,sha256=liIL1QV89i2wUHeYplauF7TpYQomobwtRFFjBhU5E3c,3370
14
- database_wrapper-0.1.37.dist-info/WHEEL,sha256=a7TGlA-5DaHMRrarXjVbQagU3Man_dCnGIWMJr5kRWo,91
15
- database_wrapper-0.1.37.dist-info/top_level.txt,sha256=QcnS4ocJygxcKE5eoOqriuja306oVu-zJRn6yjRRhBw,17
16
- database_wrapper-0.1.37.dist-info/RECORD,,
13
+ database_wrapper-0.1.40.dist-info/METADATA,sha256=j57b4EmuqIxu6ccLG5dbvUmCBdTPsZ1gfPn1CSerEZs,3370
14
+ database_wrapper-0.1.40.dist-info/WHEEL,sha256=R06PA3UVYHThwHvxuRWMqaGcr-PuniXahwjmQRFMEkY,91
15
+ database_wrapper-0.1.40.dist-info/top_level.txt,sha256=QcnS4ocJygxcKE5eoOqriuja306oVu-zJRn6yjRRhBw,17
16
+ database_wrapper-0.1.40.dist-info/RECORD,,
@@ -1,5 +1,5 @@
1
1
  Wheel-Version: 1.0
2
- Generator: setuptools (75.4.0)
2
+ Generator: setuptools (75.5.0)
3
3
  Root-Is-Purelib: true
4
4
  Tag: py3-none-any
5
5