database-wrapper 0.1.87__tar.gz → 0.1.88__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.
- {database_wrapper-0.1.87 → database_wrapper-0.1.88}/PKG-INFO +5 -5
- {database_wrapper-0.1.87 → database_wrapper-0.1.88}/database_wrapper/config.py +3 -3
- {database_wrapper-0.1.87 → database_wrapper-0.1.88}/database_wrapper/db_backend.py +16 -12
- {database_wrapper-0.1.87 → database_wrapper-0.1.88}/database_wrapper.egg-info/PKG-INFO +5 -5
- {database_wrapper-0.1.87 → database_wrapper-0.1.88}/database_wrapper.egg-info/requires.txt +4 -4
- {database_wrapper-0.1.87 → database_wrapper-0.1.88}/pyproject.toml +5 -5
- {database_wrapper-0.1.87 → database_wrapper-0.1.88}/README.md +0 -0
- {database_wrapper-0.1.87 → database_wrapper-0.1.88}/database_wrapper/__init__.py +0 -0
- {database_wrapper-0.1.87 → database_wrapper-0.1.88}/database_wrapper/abc.py +0 -0
- {database_wrapper-0.1.87 → database_wrapper-0.1.88}/database_wrapper/common.py +0 -0
- {database_wrapper-0.1.87 → database_wrapper-0.1.88}/database_wrapper/db_data_model.py +0 -0
- {database_wrapper-0.1.87 → database_wrapper-0.1.88}/database_wrapper/db_wrapper.py +0 -0
- {database_wrapper-0.1.87 → database_wrapper-0.1.88}/database_wrapper/db_wrapper_async.py +0 -0
- {database_wrapper-0.1.87 → database_wrapper-0.1.88}/database_wrapper/db_wrapper_mixin.py +0 -0
- {database_wrapper-0.1.87 → database_wrapper-0.1.88}/database_wrapper/py.typed +0 -0
- {database_wrapper-0.1.87 → database_wrapper-0.1.88}/database_wrapper/serialization.py +0 -0
- {database_wrapper-0.1.87 → database_wrapper-0.1.88}/database_wrapper/utils/__init__.py +0 -0
- {database_wrapper-0.1.87 → database_wrapper-0.1.88}/database_wrapper/utils/dataclass_addons.py +0 -0
- {database_wrapper-0.1.87 → database_wrapper-0.1.88}/database_wrapper.egg-info/SOURCES.txt +0 -0
- {database_wrapper-0.1.87 → database_wrapper-0.1.88}/database_wrapper.egg-info/dependency_links.txt +0 -0
- {database_wrapper-0.1.87 → database_wrapper-0.1.88}/database_wrapper.egg-info/top_level.txt +0 -0
- {database_wrapper-0.1.87 → database_wrapper-0.1.88}/setup.cfg +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: database_wrapper
|
|
3
|
-
Version: 0.1.
|
|
3
|
+
Version: 0.1.88
|
|
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)
|
|
@@ -33,13 +33,13 @@ Classifier: Topic :: Software Development :: Libraries :: Python Modules
|
|
|
33
33
|
Requires-Python: >=3.8
|
|
34
34
|
Description-Content-Type: text/markdown
|
|
35
35
|
Provides-Extra: pgsql
|
|
36
|
-
Requires-Dist: database_wrapper_pgsql==0.1.
|
|
36
|
+
Requires-Dist: database_wrapper_pgsql==0.1.88; extra == "pgsql"
|
|
37
37
|
Provides-Extra: mysql
|
|
38
|
-
Requires-Dist: database_wrapper_mysql==0.1.
|
|
38
|
+
Requires-Dist: database_wrapper_mysql==0.1.88; extra == "mysql"
|
|
39
39
|
Provides-Extra: mssql
|
|
40
|
-
Requires-Dist: database_wrapper_mssql==0.1.
|
|
40
|
+
Requires-Dist: database_wrapper_mssql==0.1.88; extra == "mssql"
|
|
41
41
|
Provides-Extra: sqlite
|
|
42
|
-
Requires-Dist: database_wrapper_sqlite==0.1.
|
|
42
|
+
Requires-Dist: database_wrapper_sqlite==0.1.88; extra == "sqlite"
|
|
43
43
|
Provides-Extra: all
|
|
44
44
|
Requires-Dist: database_wrapper[mssql,mysql,pgsql,sqlite]; extra == "all"
|
|
45
45
|
Provides-Extra: dev
|
|
@@ -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": "
|
|
7
|
-
"git_commit_date": "
|
|
8
|
-
"app_version": "0.1.
|
|
6
|
+
"git_commit_hash": "3b140044c9c3f01102ec24e8739906b577491571",
|
|
7
|
+
"git_commit_date": "19.06.2025 12:03",
|
|
8
|
+
"app_version": "0.1.88",
|
|
9
9
|
}
|
|
@@ -90,9 +90,7 @@ class DatabaseBackend:
|
|
|
90
90
|
self.cursor = None
|
|
91
91
|
self.shutdownRequested = Event()
|
|
92
92
|
self.contextConnection = ContextVar(f"db_connection_{self.name}", default=None)
|
|
93
|
-
self.contextConnectionAsync = ContextVar(
|
|
94
|
-
f"db_connection_{self.name}_async", default=None
|
|
95
|
-
)
|
|
93
|
+
self.contextConnectionAsync = ContextVar(f"db_connection_{self.name}_async", default=None)
|
|
96
94
|
|
|
97
95
|
def __del__(self) -> None:
|
|
98
96
|
"""What to do when class is destroyed"""
|
|
@@ -147,14 +145,22 @@ class DatabaseBackend:
|
|
|
147
145
|
|
|
148
146
|
def close(self) -> Any:
|
|
149
147
|
"""Close connections"""
|
|
150
|
-
|
|
151
|
-
self.
|
|
152
|
-
|
|
148
|
+
try:
|
|
149
|
+
if self.cursor:
|
|
150
|
+
self.logger.debug("Closing cursor")
|
|
151
|
+
self.cursor.close()
|
|
152
|
+
except Exception as e:
|
|
153
|
+
self.logger.debug(f"Error while closing cursor: {e}")
|
|
154
|
+
finally:
|
|
153
155
|
self.cursor = None
|
|
154
156
|
|
|
155
|
-
|
|
156
|
-
self.
|
|
157
|
-
|
|
157
|
+
try:
|
|
158
|
+
if self.connection:
|
|
159
|
+
self.logger.debug("Closing connection")
|
|
160
|
+
self.connection.close()
|
|
161
|
+
except Exception as e:
|
|
162
|
+
self.logger.debug(f"Error while closing connection: {e}")
|
|
163
|
+
finally:
|
|
158
164
|
self.connection = None
|
|
159
165
|
|
|
160
166
|
def newConnection(self) -> Any:
|
|
@@ -227,9 +233,7 @@ class DatabaseBackend:
|
|
|
227
233
|
s.setsockopt(socket.IPPROTO_TCP, socket.TCP_KEEPCNT, 3)
|
|
228
234
|
# To set timeout for an RTO you must set TCP_USER_TIMEOUT timeout
|
|
229
235
|
# (in milliseconds) for socket.
|
|
230
|
-
s.setsockopt(
|
|
231
|
-
socket.IPPROTO_TCP, socket.TCP_USER_TIMEOUT, self.connectionTimeout * 1000
|
|
232
|
-
)
|
|
236
|
+
s.setsockopt(socket.IPPROTO_TCP, socket.TCP_USER_TIMEOUT, self.connectionTimeout * 1000)
|
|
233
237
|
|
|
234
238
|
####################
|
|
235
239
|
### Transactions ###
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: database_wrapper
|
|
3
|
-
Version: 0.1.
|
|
3
|
+
Version: 0.1.88
|
|
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)
|
|
@@ -33,13 +33,13 @@ Classifier: Topic :: Software Development :: Libraries :: Python Modules
|
|
|
33
33
|
Requires-Python: >=3.8
|
|
34
34
|
Description-Content-Type: text/markdown
|
|
35
35
|
Provides-Extra: pgsql
|
|
36
|
-
Requires-Dist: database_wrapper_pgsql==0.1.
|
|
36
|
+
Requires-Dist: database_wrapper_pgsql==0.1.88; extra == "pgsql"
|
|
37
37
|
Provides-Extra: mysql
|
|
38
|
-
Requires-Dist: database_wrapper_mysql==0.1.
|
|
38
|
+
Requires-Dist: database_wrapper_mysql==0.1.88; extra == "mysql"
|
|
39
39
|
Provides-Extra: mssql
|
|
40
|
-
Requires-Dist: database_wrapper_mssql==0.1.
|
|
40
|
+
Requires-Dist: database_wrapper_mssql==0.1.88; extra == "mssql"
|
|
41
41
|
Provides-Extra: sqlite
|
|
42
|
-
Requires-Dist: database_wrapper_sqlite==0.1.
|
|
42
|
+
Requires-Dist: database_wrapper_sqlite==0.1.88; extra == "sqlite"
|
|
43
43
|
Provides-Extra: all
|
|
44
44
|
Requires-Dist: database_wrapper[mssql,mysql,pgsql,sqlite]; extra == "all"
|
|
45
45
|
Provides-Extra: dev
|
|
@@ -17,13 +17,13 @@ mysqlclient>=2.2.2
|
|
|
17
17
|
pymssql>=2.2.10
|
|
18
18
|
|
|
19
19
|
[mssql]
|
|
20
|
-
database_wrapper_mssql==0.1.
|
|
20
|
+
database_wrapper_mssql==0.1.88
|
|
21
21
|
|
|
22
22
|
[mysql]
|
|
23
|
-
database_wrapper_mysql==0.1.
|
|
23
|
+
database_wrapper_mysql==0.1.88
|
|
24
24
|
|
|
25
25
|
[pgsql]
|
|
26
|
-
database_wrapper_pgsql==0.1.
|
|
26
|
+
database_wrapper_pgsql==0.1.88
|
|
27
27
|
|
|
28
28
|
[sqlite]
|
|
29
|
-
database_wrapper_sqlite==0.1.
|
|
29
|
+
database_wrapper_sqlite==0.1.88
|
|
@@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"
|
|
|
4
4
|
|
|
5
5
|
[project]
|
|
6
6
|
name = "database_wrapper"
|
|
7
|
-
version = "0.1.
|
|
7
|
+
version = "0.1.88"
|
|
8
8
|
description = "A Different Approach to Database Wrappers in Python"
|
|
9
9
|
readme = "README.md"
|
|
10
10
|
requires-python = ">=3.8"
|
|
@@ -45,10 +45,10 @@ Code = "https://github.com/gintsmurans/py_database_wrapper"
|
|
|
45
45
|
Download = "https://pypi.org/project/database_wrapper/"
|
|
46
46
|
|
|
47
47
|
[project.optional-dependencies]
|
|
48
|
-
pgsql = ["database_wrapper_pgsql == 0.1.
|
|
49
|
-
mysql = ["database_wrapper_mysql == 0.1.
|
|
50
|
-
mssql = ["database_wrapper_mssql == 0.1.
|
|
51
|
-
sqlite = ["database_wrapper_sqlite == 0.1.
|
|
48
|
+
pgsql = ["database_wrapper_pgsql == 0.1.88"]
|
|
49
|
+
mysql = ["database_wrapper_mysql == 0.1.88"]
|
|
50
|
+
mssql = ["database_wrapper_mssql == 0.1.88"]
|
|
51
|
+
sqlite = ["database_wrapper_sqlite == 0.1.88"]
|
|
52
52
|
all = ["database_wrapper[pgsql,mysql,mssql,sqlite]"]
|
|
53
53
|
dev = [
|
|
54
54
|
# Development
|
|
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
|
{database_wrapper-0.1.87 → database_wrapper-0.1.88}/database_wrapper/utils/dataclass_addons.py
RENAMED
|
File without changes
|
|
File without changes
|
{database_wrapper-0.1.87 → database_wrapper-0.1.88}/database_wrapper.egg-info/dependency_links.txt
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|