database-wrapper-pgsql 0.2.26__py3-none-any.whl → 0.2.27__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.
@@ -123,6 +123,7 @@ class Pgsql(DatabaseBackend):
123
123
  if db_conn:
124
124
  with db_conn.transaction() as trans:
125
125
  yield trans
126
+ return
126
127
 
127
128
  assert self.connection, "Connection is not initialized"
128
129
  with self.connection.transaction() as trans:
@@ -261,6 +262,7 @@ class PgsqlAsync(DatabaseBackend):
261
262
  if db_conn:
262
263
  async with db_conn.transaction() as trans:
263
264
  yield trans
265
+ return
264
266
 
265
267
  assert self.connection, "Connection is not initialized"
266
268
  async with self.connection.transaction() as trans:
@@ -522,6 +524,7 @@ class PgsqlWithPooling(DatabaseBackend):
522
524
  if db_conn:
523
525
  with db_conn.transaction() as trans:
524
526
  yield trans
527
+ return
525
528
 
526
529
  assert self.connection, "Connection is not initialized"
527
530
  with self.connection.transaction() as trans:
@@ -684,7 +687,7 @@ class PgsqlWithPoolingAsync(DatabaseBackend):
684
687
  # Close async pool
685
688
  self.logger.debug("Closing connection pool")
686
689
  await self.close()
687
- if hasattr(self, "poolAsync") and self.pool_async.closed is False:
690
+ if hasattr(self, "pool_async") and self.pool_async.closed is False:
688
691
  await self.pool_async.close()
689
692
 
690
693
  async def open(self) -> None:
@@ -806,6 +809,7 @@ class PgsqlWithPoolingAsync(DatabaseBackend):
806
809
  if db_conn:
807
810
  async with db_conn.transaction() as trans:
808
811
  yield trans
812
+ return
809
813
 
810
814
  assert self.connection, "Connection is not initialized"
811
815
  async with self.connection.transaction() as trans:
@@ -70,8 +70,14 @@ class DBWrapperPgsqlMixin:
70
70
  if order_by is None:
71
71
  return None
72
72
 
73
- order_list = [f"{item[0]} {item[1] if len(item) > 1 and item[1] is not None else 'ASC'}" for item in order_by]
74
- return sql.SQL("ORDER BY {}".format(", ".join(order_list)))
73
+ order_list = [
74
+ sql.SQL("{} {}").format(
75
+ sql.Identifier(item[0]),
76
+ sql.SQL(item[1] if len(item) > 1 and item[1] is not None else "ASC"),
77
+ )
78
+ for item in order_by
79
+ ]
80
+ return sql.SQL("ORDER BY ") + sql.SQL(", ").join(order_list)
75
81
 
76
82
  def limit_query(
77
83
  self,
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: database_wrapper_pgsql
3
- Version: 0.2.26
3
+ Version: 0.2.27
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.2.26
35
+ Requires-Dist: database_wrapper==0.2.27
36
36
  Requires-Dist: psycopg[binary]>=3.2.0
37
37
  Requires-Dist: psycopg[pool]>=3.2.0
38
38
 
@@ -1,12 +1,12 @@
1
1
  database_wrapper_pgsql/__init__.py,sha256=p1CkqOmXI61cy3uzpnRtukUG8vQrLfXCFPrwDfOEvFU,1161
2
- database_wrapper_pgsql/connector.py,sha256=nf_13q24UFiyliswJqfhaXTaZ2acOv2TXxkPpWYSdMA,25455
2
+ database_wrapper_pgsql/connector.py,sha256=l1Dk35hnSDlGhgdzB4ldrJa6QL83CKn-VgD_R11P2Go,25548
3
3
  database_wrapper_pgsql/db_wrapper_pgsql.py,sha256=lrMN9lqfS0JapEfNu2sFeFxifK67eBhZZebU3MpvnRk,1909
4
4
  database_wrapper_pgsql/db_wrapper_pgsql_async.py,sha256=cYYyBFWvVG3e24Ik0mJXnbxic9bskqnB-K3hEbJ6pk8,2025
5
- database_wrapper_pgsql/db_wrapper_pgsql_mixin.py,sha256=QX3IvBAr82Wpq0P9sRDxfmxO17WcAUzShTUiKl1MWz4,5322
5
+ database_wrapper_pgsql/db_wrapper_pgsql_mixin.py,sha256=m6scMsSCAE7mhU2wV3D_V9hFS52zP1_SFwIiAIVKFKo,5448
6
6
  database_wrapper_pgsql/pg_introspector.py,sha256=mMIosvQZZNE3ocAF7Wys50gYBjXrT9EaI-xcTWt-UnQ,2557
7
7
  database_wrapper_pgsql/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
8
8
  database_wrapper_pgsql/type_mapping.py,sha256=KWIAT78Z6h5DEt8uQNfQP6t5ahBUPuLKgcPfQmIywM4,1625
9
- database_wrapper_pgsql-0.2.26.dist-info/METADATA,sha256=nc2-EgRiYPkE2715faMjZSWyuqvClu_5oQX0sOaR5y4,3231
10
- database_wrapper_pgsql-0.2.26.dist-info/WHEEL,sha256=YCfwYGOYMi5Jhw2fU4yNgwErybb2IX5PEwBKV4ZbdBo,91
11
- database_wrapper_pgsql-0.2.26.dist-info/top_level.txt,sha256=EQhZLk12wRdsSp-Lo3Jc4cXmNfG8y5EouNv_7OBCSGo,23
12
- database_wrapper_pgsql-0.2.26.dist-info/RECORD,,
9
+ database_wrapper_pgsql-0.2.27.dist-info/METADATA,sha256=_zPny-Hket83M0NjVTfxtQiu8ARClycai7nhrs769v8,3231
10
+ database_wrapper_pgsql-0.2.27.dist-info/WHEEL,sha256=aeYiig01lYGDzBgS8HxWXOg3uV61G9ijOsup-k9o1sk,91
11
+ database_wrapper_pgsql-0.2.27.dist-info/top_level.txt,sha256=EQhZLk12wRdsSp-Lo3Jc4cXmNfG8y5EouNv_7OBCSGo,23
12
+ database_wrapper_pgsql-0.2.27.dist-info/RECORD,,
@@ -1,5 +1,5 @@
1
1
  Wheel-Version: 1.0
2
- Generator: setuptools (82.0.0)
2
+ Generator: setuptools (82.0.1)
3
3
  Root-Is-Purelib: true
4
4
  Tag: py3-none-any
5
5