database-wrapper 0.2.23__py3-none-any.whl → 0.2.24__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": "31a698fb162f0f3b837da41c631aadd26afa4973",
7
- "git_commit_date": "10.01.2026 01:39",
8
- "app_version": "0.2.23",
6
+ "git_commit_hash": "62c0c673862251219e0f5ea144907fbaaf35cba3",
7
+ "git_commit_date": "04.02.2026 14:08",
8
+ "app_version": "0.2.24",
9
9
  }
@@ -148,14 +148,22 @@ class DatabaseBackend:
148
148
 
149
149
  def close(self) -> Any:
150
150
  """Close connections"""
151
- if self.cursor:
152
- self.logger.debug("Closing cursor")
153
- self.cursor.close()
151
+ try:
152
+ if self.cursor:
153
+ self.logger.debug("Closing cursor")
154
+ self.cursor.close()
155
+ except Exception as e:
156
+ self.logger.debug(f"Error while closing cursor: {e}")
157
+ finally:
154
158
  self.cursor = None
155
159
 
156
- if self.connection:
157
- self.logger.debug("Closing connection")
158
- self.connection.close()
160
+ try:
161
+ if self.connection:
162
+ self.logger.debug("Closing connection")
163
+ self.connection.close()
164
+ except Exception as e:
165
+ self.logger.debug(f"Error while closing connection: {e}")
166
+ finally:
159
167
  self.connection = None
160
168
 
161
169
  def new_connection(self) -> Any:
@@ -228,9 +236,7 @@ class DatabaseBackend:
228
236
  s.setsockopt(socket.IPPROTO_TCP, socket.TCP_KEEPCNT, 3)
229
237
  # To set timeout for an RTO you must set TCP_USER_TIMEOUT timeout
230
238
  # (in milliseconds) for socket.
231
- s.setsockopt(
232
- socket.IPPROTO_TCP, socket.TCP_USER_TIMEOUT, self.connection_timeout * 1000
233
- )
239
+ s.setsockopt(socket.IPPROTO_TCP, socket.TCP_USER_TIMEOUT, self.connection_timeout * 1000)
234
240
 
235
241
  ####################
236
242
  ### Transactions ###
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: database_wrapper
3
- Version: 0.2.23
3
+ Version: 0.2.24
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,15 +33,15 @@ 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.2.23; extra == "pgsql"
36
+ Requires-Dist: database_wrapper_pgsql==0.2.24; extra == "pgsql"
37
37
  Provides-Extra: mysql
38
- Requires-Dist: database_wrapper_mysql==0.2.23; extra == "mysql"
38
+ Requires-Dist: database_wrapper_mysql==0.2.24; extra == "mysql"
39
39
  Provides-Extra: mssql
40
- Requires-Dist: database_wrapper_mssql==0.2.23; extra == "mssql"
40
+ Requires-Dist: database_wrapper_mssql==0.2.24; extra == "mssql"
41
41
  Provides-Extra: sqlite
42
- Requires-Dist: database_wrapper_sqlite==0.2.23; extra == "sqlite"
42
+ Requires-Dist: database_wrapper_sqlite==0.2.24; extra == "sqlite"
43
43
  Provides-Extra: redis
44
- Requires-Dist: database_wrapper_redis==0.2.23; extra == "redis"
44
+ Requires-Dist: database_wrapper_redis==0.2.24; extra == "redis"
45
45
  Provides-Extra: all
46
46
  Requires-Dist: database_wrapper[mssql,mysql,pgsql,redis,sqlite]; extra == "all"
47
47
  Provides-Extra: dev
@@ -1,8 +1,8 @@
1
1
  database_wrapper/__init__.py,sha256=aV6eFoz03yDZr-ba0O59yECowlmfNYVUkKqSE-BYz8w,1320
2
2
  database_wrapper/abc.py,sha256=zerWfTTUuYqFJoCTO4HGsCPETz0Zk4re2wKB_4x2pv4,2056
3
3
  database_wrapper/common.py,sha256=fsxe28o_4xCrotPbB274dmzQ9rOyes0sBtcHog-9RVc,258
4
- database_wrapper/config.py,sha256=SLUeRa6jZmAXupTyMUVSKPvyAp2q5NU0Nj8n7Vpq15s,334
5
- database_wrapper/db_backend.py,sha256=2JhNlPhFfo6LeweCwIuM-SfvB1Ga9Bst4sXiUmrFKEM,7954
4
+ database_wrapper/config.py,sha256=byCL_epzhEcoHvpP5iSMVMRB5dYTnZODhPErO1MOMwY,334
5
+ database_wrapper/db_backend.py,sha256=MOJLPlF06RjA2_4y3z5j2Tq4IRuSM8sibuGzFpGp_Vw,8214
6
6
  database_wrapper/db_data_model.py,sha256=JhpkgBcJn1vrQG3AnjQloU7fk907wdNkTXLDug_7pGA,15590
7
7
  database_wrapper/db_introspector.py,sha256=vFR9VdAEMQyfLI8U4zwHKt5F1ZJuxe8wHsWnySLAJz4,15373
8
8
  database_wrapper/db_wrapper.py,sha256=Cxl8Pw_-CRygf85h5_v-dgh5YM0MSJ-vVhTzJocNFQg,15186
@@ -12,7 +12,7 @@ database_wrapper/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
12
12
  database_wrapper/serialization.py,sha256=X9N7YPZfy_D09yr61zsdgbmxUb_0cuq5Dbu8a-txd6s,2883
13
13
  database_wrapper/utils/__init__.py,sha256=uC8YaJqfyFIZIeNdTRTbZwcOUVhmnS5eyOG-9gMs70c,96
14
14
  database_wrapper/utils/dataclass_addons.py,sha256=UDztvz_UwYmZ8Jk_UzZjfy8YbwmPIutT1XzWaep-ht0,780
15
- database_wrapper-0.2.23.dist-info/METADATA,sha256=CemJASbsqrc7HR3xGSLXfXMi-_NJyczD9VC7hUp5kiI,3602
16
- database_wrapper-0.2.23.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
17
- database_wrapper-0.2.23.dist-info/top_level.txt,sha256=QcnS4ocJygxcKE5eoOqriuja306oVu-zJRn6yjRRhBw,17
18
- database_wrapper-0.2.23.dist-info/RECORD,,
15
+ database_wrapper-0.2.24.dist-info/METADATA,sha256=Vuu1AsTjzSnPkxCnryGXg-CR1QeBJPEzZxJe_BfzIQ0,3602
16
+ database_wrapper-0.2.24.dist-info/WHEEL,sha256=wUyA8OaulRlbfwMtmQsvNngGrxQHAvkKcvRmdizlJi0,92
17
+ database_wrapper-0.2.24.dist-info/top_level.txt,sha256=QcnS4ocJygxcKE5eoOqriuja306oVu-zJRn6yjRRhBw,17
18
+ database_wrapper-0.2.24.dist-info/RECORD,,
@@ -1,5 +1,5 @@
1
1
  Wheel-Version: 1.0
2
- Generator: setuptools (80.9.0)
2
+ Generator: setuptools (80.10.2)
3
3
  Root-Is-Purelib: true
4
4
  Tag: py3-none-any
5
5