database-wrapper-pgsql 0.1.87__py3-none-any.whl → 0.1.88__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.
- database_wrapper_pgsql/connector.py +18 -12
- {database_wrapper_pgsql-0.1.87.dist-info → database_wrapper_pgsql-0.1.88.dist-info}/METADATA +2 -2
- {database_wrapper_pgsql-0.1.87.dist-info → database_wrapper_pgsql-0.1.88.dist-info}/RECORD +5 -5
- {database_wrapper_pgsql-0.1.87.dist-info → database_wrapper_pgsql-0.1.88.dist-info}/WHEEL +1 -1
- {database_wrapper_pgsql-0.1.87.dist-info → database_wrapper_pgsql-0.1.88.dist-info}/top_level.txt +0 -0
|
@@ -226,13 +226,23 @@ class PgSQLAsync(DatabaseBackend):
|
|
|
226
226
|
|
|
227
227
|
async def close(self) -> Any:
|
|
228
228
|
"""Close connections"""
|
|
229
|
-
|
|
230
|
-
self.
|
|
231
|
-
|
|
229
|
+
try:
|
|
230
|
+
if self.cursor:
|
|
231
|
+
self.logger.debug("Closing cursor")
|
|
232
|
+
await self.cursor.close()
|
|
233
|
+
except Exception as e:
|
|
234
|
+
self.logger.debug(f"Error while closing cursor: {e}")
|
|
235
|
+
finally:
|
|
236
|
+
self.cursor = None
|
|
232
237
|
|
|
233
|
-
|
|
234
|
-
self.
|
|
235
|
-
|
|
238
|
+
try:
|
|
239
|
+
if self.connection:
|
|
240
|
+
self.logger.debug("Closing connection")
|
|
241
|
+
await self.connection.close()
|
|
242
|
+
except Exception as e:
|
|
243
|
+
self.logger.debug(f"Error while closing connection: {e}")
|
|
244
|
+
finally:
|
|
245
|
+
self.connection = None
|
|
236
246
|
|
|
237
247
|
async def ping(self) -> bool:
|
|
238
248
|
try:
|
|
@@ -594,9 +604,7 @@ class PgSQLWithPoolingAsync(DatabaseBackend):
|
|
|
594
604
|
cursor: PgCursorTypeAsync | None
|
|
595
605
|
""" Cursor to database """
|
|
596
606
|
|
|
597
|
-
contextConnectionAsync: ContextVar[
|
|
598
|
-
tuple[PgConnectionTypeAsync, PgCursorTypeAsync] | None
|
|
599
|
-
]
|
|
607
|
+
contextConnectionAsync: ContextVar[tuple[PgConnectionTypeAsync, PgCursorTypeAsync] | None]
|
|
600
608
|
""" Connection used in async context manager """
|
|
601
609
|
|
|
602
610
|
########################
|
|
@@ -720,9 +728,7 @@ class PgSQLWithPoolingAsync(DatabaseBackend):
|
|
|
720
728
|
while not self.shutdownRequested.is_set():
|
|
721
729
|
connection = None
|
|
722
730
|
try:
|
|
723
|
-
connection = await self.poolAsync.getconn(
|
|
724
|
-
timeout=self.connectionTimeout
|
|
725
|
-
)
|
|
731
|
+
connection = await self.poolAsync.getconn(timeout=self.connectionTimeout)
|
|
726
732
|
cursor = connection.cursor(row_factory=PgDictRowFactory)
|
|
727
733
|
|
|
728
734
|
# Lets do some socket magic
|
{database_wrapper_pgsql-0.1.87.dist-info → database_wrapper_pgsql-0.1.88.dist-info}/METADATA
RENAMED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: database_wrapper_pgsql
|
|
3
|
-
Version: 0.1.
|
|
3
|
+
Version: 0.1.88
|
|
4
4
|
Summary: database_wrapper for PostgreSQL database
|
|
5
5
|
Author-email: Gints Murans <gm@gm.lv>
|
|
6
6
|
License: GNU General Public License v3.0 (GPL-3.0)
|
|
@@ -32,7 +32,7 @@ Classifier: Topic :: Software Development
|
|
|
32
32
|
Classifier: Topic :: Software Development :: Libraries :: Python Modules
|
|
33
33
|
Requires-Python: >=3.8
|
|
34
34
|
Description-Content-Type: text/markdown
|
|
35
|
-
Requires-Dist: database_wrapper==0.1.
|
|
35
|
+
Requires-Dist: database_wrapper==0.1.88
|
|
36
36
|
Requires-Dist: psycopg[binary]>=3.2.0
|
|
37
37
|
Requires-Dist: psycopg[pool]>=3.2.0
|
|
38
38
|
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
database_wrapper_pgsql/__init__.py,sha256=9QvHYUq5EgEpqIaZArrm30v_USM5zIaf0UN-z6cHWhs,1058
|
|
2
|
-
database_wrapper_pgsql/connector.py,sha256=
|
|
2
|
+
database_wrapper_pgsql/connector.py,sha256=rvxYs6EIPs6FRROhb_EcaKVXZSeAY7Ks33hhHzPHzcM,25192
|
|
3
3
|
database_wrapper_pgsql/db_wrapper_pgsql.py,sha256=v4GGsheZljELurAuaQDTI6ZFoFGjThQ9MubRpRj3dVc,1906
|
|
4
4
|
database_wrapper_pgsql/db_wrapper_pgsql_async.py,sha256=sSCHLHvKnf7i_Dy8K8_XKa6hWMc26W9hJqU4nbN0v_c,2009
|
|
5
5
|
database_wrapper_pgsql/db_wrapper_pgsql_mixin.py,sha256=D0RKSGnZsyC3XbhQeGgblCP3W9530at2j9O5CaSc2GI,5377
|
|
6
6
|
database_wrapper_pgsql/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
7
|
-
database_wrapper_pgsql-0.1.
|
|
8
|
-
database_wrapper_pgsql-0.1.
|
|
9
|
-
database_wrapper_pgsql-0.1.
|
|
10
|
-
database_wrapper_pgsql-0.1.
|
|
7
|
+
database_wrapper_pgsql-0.1.88.dist-info/METADATA,sha256=MFDRRZqXZqQ9IdACsWja5KAXL148B4xBOO6NZmlBVn0,3231
|
|
8
|
+
database_wrapper_pgsql-0.1.88.dist-info/WHEEL,sha256=wUyA8OaulRlbfwMtmQsvNngGrxQHAvkKcvRmdizlJi0,92
|
|
9
|
+
database_wrapper_pgsql-0.1.88.dist-info/top_level.txt,sha256=EQhZLk12wRdsSp-Lo3Jc4cXmNfG8y5EouNv_7OBCSGo,23
|
|
10
|
+
database_wrapper_pgsql-0.1.88.dist-info/RECORD,,
|
{database_wrapper_pgsql-0.1.87.dist-info → database_wrapper_pgsql-0.1.88.dist-info}/top_level.txt
RENAMED
|
File without changes
|