database-wrapper-pgsql 0.1.86__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.
Files changed (15) hide show
  1. {database_wrapper_pgsql-0.1.86 → database_wrapper_pgsql-0.1.88}/PKG-INFO +2 -2
  2. {database_wrapper_pgsql-0.1.86 → database_wrapper_pgsql-0.1.88}/database_wrapper_pgsql/connector.py +18 -12
  3. {database_wrapper_pgsql-0.1.86 → database_wrapper_pgsql-0.1.88}/database_wrapper_pgsql.egg-info/PKG-INFO +2 -2
  4. {database_wrapper_pgsql-0.1.86 → database_wrapper_pgsql-0.1.88}/database_wrapper_pgsql.egg-info/requires.txt +1 -1
  5. {database_wrapper_pgsql-0.1.86 → database_wrapper_pgsql-0.1.88}/pyproject.toml +2 -2
  6. {database_wrapper_pgsql-0.1.86 → database_wrapper_pgsql-0.1.88}/README.md +0 -0
  7. {database_wrapper_pgsql-0.1.86 → database_wrapper_pgsql-0.1.88}/database_wrapper_pgsql/__init__.py +0 -0
  8. {database_wrapper_pgsql-0.1.86 → database_wrapper_pgsql-0.1.88}/database_wrapper_pgsql/db_wrapper_pgsql.py +0 -0
  9. {database_wrapper_pgsql-0.1.86 → database_wrapper_pgsql-0.1.88}/database_wrapper_pgsql/db_wrapper_pgsql_async.py +0 -0
  10. {database_wrapper_pgsql-0.1.86 → database_wrapper_pgsql-0.1.88}/database_wrapper_pgsql/db_wrapper_pgsql_mixin.py +0 -0
  11. {database_wrapper_pgsql-0.1.86 → database_wrapper_pgsql-0.1.88}/database_wrapper_pgsql/py.typed +0 -0
  12. {database_wrapper_pgsql-0.1.86 → database_wrapper_pgsql-0.1.88}/database_wrapper_pgsql.egg-info/SOURCES.txt +0 -0
  13. {database_wrapper_pgsql-0.1.86 → database_wrapper_pgsql-0.1.88}/database_wrapper_pgsql.egg-info/dependency_links.txt +0 -0
  14. {database_wrapper_pgsql-0.1.86 → database_wrapper_pgsql-0.1.88}/database_wrapper_pgsql.egg-info/top_level.txt +0 -0
  15. {database_wrapper_pgsql-0.1.86 → database_wrapper_pgsql-0.1.88}/setup.cfg +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: database_wrapper_pgsql
3
- Version: 0.1.86
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.86
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
 
@@ -226,13 +226,23 @@ class PgSQLAsync(DatabaseBackend):
226
226
 
227
227
  async def close(self) -> Any:
228
228
  """Close connections"""
229
- if self.cursor:
230
- self.logger.debug("Closing cursor")
231
- await self.cursor.close()
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
- if self.connection:
234
- self.logger.debug("Closing connection")
235
- await self.connection.close()
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
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: database_wrapper_pgsql
3
- Version: 0.1.86
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.86
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,3 +1,3 @@
1
- database_wrapper==0.1.86
1
+ database_wrapper==0.1.88
2
2
  psycopg[binary]>=3.2.0
3
3
  psycopg[pool]>=3.2.0
@@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"
4
4
 
5
5
  [project]
6
6
  name = "database_wrapper_pgsql"
7
- version = "0.1.86"
7
+ version = "0.1.88"
8
8
  description = "database_wrapper for PostgreSQL database"
9
9
  readme = "README.md"
10
10
  requires-python = ">=3.8"
@@ -35,7 +35,7 @@ classifiers = [
35
35
  ]
36
36
  keywords = ["database", "wrapper", "python", "postgresql", "pgsql"]
37
37
  dependencies = [
38
- "database_wrapper == 0.1.86",
38
+ "database_wrapper == 0.1.88",
39
39
  "psycopg[binary] >= 3.2.0",
40
40
  "psycopg[pool] >= 3.2.0",
41
41
  ]