database-wrapper-pgsql 0.1.37__tar.gz → 0.1.38__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.37 → database_wrapper_pgsql-0.1.38}/PKG-INFO +2 -2
  2. {database_wrapper_pgsql-0.1.37 → database_wrapper_pgsql-0.1.38}/database_wrapper_pgsql/db_wrapper_pgsql.py +23 -1
  3. {database_wrapper_pgsql-0.1.37 → database_wrapper_pgsql-0.1.38}/database_wrapper_pgsql/db_wrapper_pgsql_async.py +23 -1
  4. {database_wrapper_pgsql-0.1.37 → database_wrapper_pgsql-0.1.38}/database_wrapper_pgsql.egg-info/PKG-INFO +2 -2
  5. {database_wrapper_pgsql-0.1.37 → database_wrapper_pgsql-0.1.38}/database_wrapper_pgsql.egg-info/requires.txt +1 -1
  6. {database_wrapper_pgsql-0.1.37 → database_wrapper_pgsql-0.1.38}/pyproject.toml +2 -2
  7. {database_wrapper_pgsql-0.1.37 → database_wrapper_pgsql-0.1.38}/README.md +0 -0
  8. {database_wrapper_pgsql-0.1.37 → database_wrapper_pgsql-0.1.38}/database_wrapper_pgsql/__init__.py +0 -0
  9. {database_wrapper_pgsql-0.1.37 → database_wrapper_pgsql-0.1.38}/database_wrapper_pgsql/connector.py +0 -0
  10. {database_wrapper_pgsql-0.1.37 → database_wrapper_pgsql-0.1.38}/database_wrapper_pgsql/db_wrapper_pgsql_mixin.py +0 -0
  11. {database_wrapper_pgsql-0.1.37 → database_wrapper_pgsql-0.1.38}/database_wrapper_pgsql/py.typed +0 -0
  12. {database_wrapper_pgsql-0.1.37 → database_wrapper_pgsql-0.1.38}/database_wrapper_pgsql.egg-info/SOURCES.txt +0 -0
  13. {database_wrapper_pgsql-0.1.37 → database_wrapper_pgsql-0.1.38}/database_wrapper_pgsql.egg-info/dependency_links.txt +0 -0
  14. {database_wrapper_pgsql-0.1.37 → database_wrapper_pgsql-0.1.38}/database_wrapper_pgsql.egg-info/top_level.txt +0 -0
  15. {database_wrapper_pgsql-0.1.37 → database_wrapper_pgsql-0.1.38}/setup.cfg +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: database_wrapper_pgsql
3
- Version: 0.1.37
3
+ Version: 0.1.38
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.37
35
+ Requires-Dist: database_wrapper==0.1.38
36
36
  Requires-Dist: psycopg[binary]>=3.2.0
37
37
  Requires-Dist: psycopg[pool]>=3.2.0
38
38
 
@@ -35,7 +35,7 @@ class DBWrapperPgSQL(DBWrapperPgSQLMixin, DBWrapper):
35
35
  # We are overriding the __init__ method for the type hinting
36
36
  def __init__(
37
37
  self,
38
- db: PgSQL,
38
+ db: PgSQL | None = None,
39
39
  dbConn: PgConnectionType | None = None,
40
40
  logger: logging.Logger | None = None,
41
41
  ):
@@ -49,6 +49,28 @@ class DBWrapperPgSQL(DBWrapperPgSQLMixin, DBWrapper):
49
49
  """
50
50
  super().__init__(db, dbConn, logger)
51
51
 
52
+ ###############
53
+ ### Setters ###
54
+ ###############
55
+
56
+ def updateDb(self, db: PgSQL) -> None:
57
+ """
58
+ Updates the database backend object.
59
+
60
+ Args:
61
+ db (DatabaseBackend): The new database backend object.
62
+ """
63
+ self.db = db
64
+
65
+ def updateDbConn(self, dbConn: PgConnectionType) -> None:
66
+ """
67
+ Updates the database connection object.
68
+
69
+ Args:
70
+ dbConn (Any): The new database connection object.
71
+ """
72
+ self.dbConn = dbConn
73
+
52
74
  ######################
53
75
  ### Helper methods ###
54
76
  ######################
@@ -38,7 +38,7 @@ class DBWrapperPgSQLAsync(DBWrapperPgSQLMixin, DBWrapperAsync):
38
38
  # We are overriding the __init__ method for the type hinting
39
39
  def __init__(
40
40
  self,
41
- db: PgSQLWithPoolingAsync,
41
+ db: PgSQLWithPoolingAsync | None = None,
42
42
  dbConn: PgAsyncConnectionType | None = None,
43
43
  logger: logging.Logger | None = None,
44
44
  ):
@@ -58,6 +58,28 @@ class DBWrapperPgSQLAsync(DBWrapperPgSQLMixin, DBWrapperAsync):
58
58
 
59
59
  await super().close()
60
60
 
61
+ ###############
62
+ ### Setters ###
63
+ ###############
64
+
65
+ def updateDb(self, db: PgSQLWithPoolingAsync) -> None:
66
+ """
67
+ Updates the database backend object.
68
+
69
+ Args:
70
+ db (DatabaseBackend): The new database backend object.
71
+ """
72
+ self.db = db
73
+
74
+ def updateDbConn(self, dbConn: PgAsyncConnectionType) -> None:
75
+ """
76
+ Updates the database connection object.
77
+
78
+ Args:
79
+ dbConn (Any): The new database connection object.
80
+ """
81
+ self.dbConn = dbConn
82
+
61
83
  ######################
62
84
  ### Helper methods ###
63
85
  ######################
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: database_wrapper_pgsql
3
- Version: 0.1.37
3
+ Version: 0.1.38
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.37
35
+ Requires-Dist: database_wrapper==0.1.38
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.37
1
+ database_wrapper==0.1.38
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.37"
7
+ version = "0.1.38"
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.37",
38
+ "database_wrapper == 0.1.38",
39
39
  "psycopg[binary] >= 3.2.0",
40
40
  "psycopg[pool] >= 3.2.0",
41
41
  ]