ry-pg-utils 1.0.7__tar.gz → 1.0.9__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 (32) hide show
  1. {ry_pg_utils-1.0.7/src/ry_pg_utils.egg-info → ry_pg_utils-1.0.9}/PKG-INFO +1 -1
  2. ry_pg_utils-1.0.9/VERSION +1 -0
  3. {ry_pg_utils-1.0.7 → ry_pg_utils-1.0.9}/src/ry_pg_utils/ipc/channels.py +1 -2
  4. {ry_pg_utils-1.0.7 → ry_pg_utils-1.0.9}/src/ry_pg_utils/updater.py +14 -6
  5. {ry_pg_utils-1.0.7 → ry_pg_utils-1.0.9/src/ry_pg_utils.egg-info}/PKG-INFO +1 -1
  6. ry_pg_utils-1.0.7/VERSION +0 -1
  7. {ry_pg_utils-1.0.7 → ry_pg_utils-1.0.9}/LICENSE +0 -0
  8. {ry_pg_utils-1.0.7 → ry_pg_utils-1.0.9}/MANIFEST.in +0 -0
  9. {ry_pg_utils-1.0.7 → ry_pg_utils-1.0.9}/README.md +0 -0
  10. {ry_pg_utils-1.0.7 → ry_pg_utils-1.0.9}/packages/base_requirements.in +0 -0
  11. {ry_pg_utils-1.0.7 → ry_pg_utils-1.0.9}/pyproject.toml +0 -0
  12. {ry_pg_utils-1.0.7 → ry_pg_utils-1.0.9}/setup.cfg +0 -0
  13. {ry_pg_utils-1.0.7 → ry_pg_utils-1.0.9}/setup.py +0 -0
  14. {ry_pg_utils-1.0.7 → ry_pg_utils-1.0.9}/src/ry_pg_utils/__init__.py +0 -0
  15. {ry_pg_utils-1.0.7 → ry_pg_utils-1.0.9}/src/ry_pg_utils/config.py +0 -0
  16. {ry_pg_utils-1.0.7 → ry_pg_utils-1.0.9}/src/ry_pg_utils/connect.py +0 -0
  17. {ry_pg_utils-1.0.7 → ry_pg_utils-1.0.9}/src/ry_pg_utils/dynamic_table.py +0 -0
  18. {ry_pg_utils-1.0.7 → ry_pg_utils-1.0.9}/src/ry_pg_utils/ipc/__init__.py +0 -0
  19. {ry_pg_utils-1.0.7 → ry_pg_utils-1.0.9}/src/ry_pg_utils/notify_trigger.py +0 -0
  20. {ry_pg_utils-1.0.7 → ry_pg_utils-1.0.9}/src/ry_pg_utils/parse_args.py +0 -0
  21. {ry_pg_utils-1.0.7 → ry_pg_utils-1.0.9}/src/ry_pg_utils/pb_types/__init__.py +0 -0
  22. {ry_pg_utils-1.0.7 → ry_pg_utils-1.0.9}/src/ry_pg_utils/pb_types/database_pb2.py +0 -0
  23. {ry_pg_utils-1.0.7 → ry_pg_utils-1.0.9}/src/ry_pg_utils/pb_types/database_pb2.pyi +0 -0
  24. {ry_pg_utils-1.0.7 → ry_pg_utils-1.0.9}/src/ry_pg_utils/pb_types/py.typed +0 -0
  25. {ry_pg_utils-1.0.7 → ry_pg_utils-1.0.9}/src/ry_pg_utils/postgres_info.py +0 -0
  26. {ry_pg_utils-1.0.7 → ry_pg_utils-1.0.9}/src/ry_pg_utils/py.typed +0 -0
  27. {ry_pg_utils-1.0.7 → ry_pg_utils-1.0.9}/src/ry_pg_utils/tools/__init__.py +0 -0
  28. {ry_pg_utils-1.0.7 → ry_pg_utils-1.0.9}/src/ry_pg_utils/tools/db_query.py +0 -0
  29. {ry_pg_utils-1.0.7 → ry_pg_utils-1.0.9}/src/ry_pg_utils.egg-info/SOURCES.txt +0 -0
  30. {ry_pg_utils-1.0.7 → ry_pg_utils-1.0.9}/src/ry_pg_utils.egg-info/dependency_links.txt +0 -0
  31. {ry_pg_utils-1.0.7 → ry_pg_utils-1.0.9}/src/ry_pg_utils.egg-info/requires.txt +0 -0
  32. {ry_pg_utils-1.0.7 → ry_pg_utils-1.0.9}/src/ry_pg_utils.egg-info/top_level.txt +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: ry-pg-utils
3
- Version: 1.0.7
3
+ Version: 1.0.9
4
4
  Summary: Utility functions for PostgreSQL
5
5
  Author: Ross Yeager
6
6
  Author-email: ryeager12@email.com
@@ -0,0 +1 @@
1
+ 1.0.9
@@ -3,10 +3,9 @@ from ry_redis_bus.channels import Channel
3
3
  from ry_pg_utils.pb_types.database_pb2 import DatabaseConfigPb # pylint: disable=no-name-in-module
4
4
  from ry_pg_utils.pb_types.database_pb2 import ( # pylint: disable=no-name-in-module
5
5
  DatabaseNotificationPb,
6
- DatabaseSettingsPb,
7
6
  )
8
7
 
9
8
  # Channels
10
9
  DATABASE_CHANNEL = Channel("DATABASE_CHANNEL", DatabaseConfigPb)
11
- DATABASE_CONFIG_CHANNEL = Channel("DATABASE_CONFIG_CHANNEL", DatabaseSettingsPb)
10
+ DATABASE_CONFIG_CHANNEL = Channel("DATABASE_CONFIG_CHANNEL", DatabaseConfigPb)
12
11
  DATABASE_NOTIFY_CHANNEL = Channel("DATABASE_NOTIFY_CHANNEL", DatabaseNotificationPb)
@@ -11,7 +11,7 @@ from ryutils.verbose import Verbose
11
11
  from ry_pg_utils.connect import close_engine, init_database, is_database_initialized
12
12
  from ry_pg_utils.ipc import channels
13
13
  from ry_pg_utils.pb_types.database_pb2 import ( # pylint: disable=no-name-in-module
14
- DatabaseSettingsPb,
14
+ DatabaseConfigPb,
15
15
  PostgresMessagePb,
16
16
  PostgresPb,
17
17
  )
@@ -21,14 +21,22 @@ DB_RETRY_TIME = 5.0
21
21
 
22
22
 
23
23
  def get_database_settings(
24
- message_pb: DatabaseSettingsPb, backend_id: str, verbose: bool = False
24
+ message_pb: DatabaseConfigPb, backend_id: str, verbose: bool = False
25
25
  ) -> T.Optional[PostgresInfo]:
26
- raw_db_config_pb = message_pb.postgres.get(backend_id, None)
26
+ # Access the nested databaseSettings field
27
+ if not message_pb.HasField("databaseSettings"):
28
+ return None
27
29
 
28
- if raw_db_config_pb is None:
30
+ database_settings = message_pb.databaseSettings
31
+
32
+ # Check if this is the primary database
33
+ if not database_settings.primaryDatabase:
29
34
  return None
30
35
 
31
- if not message_pb.primaryDatabase:
36
+ # Get the postgres config for this backend
37
+ raw_db_config_pb = database_settings.postgres.get(backend_id, None)
38
+
39
+ if raw_db_config_pb is None:
32
40
  return None
33
41
 
34
42
  db_config_pb: PostgresPb = raw_db_config_pb
@@ -84,7 +92,7 @@ class DbUpdater(RedisClientBase):
84
92
  self.logging_error_db_callback = logging_error_db_callback
85
93
 
86
94
  @message_handler
87
- def handle_database_config_message(self, message_pb: DatabaseSettingsPb) -> None:
95
+ def handle_database_config_message(self, message_pb: DatabaseConfigPb) -> None:
88
96
  database_settings = get_database_settings(message_pb, backend_id=self.backend_id)
89
97
 
90
98
  if database_settings is not None:
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: ry-pg-utils
3
- Version: 1.0.7
3
+ Version: 1.0.9
4
4
  Summary: Utility functions for PostgreSQL
5
5
  Author: Ross Yeager
6
6
  Author-email: ryeager12@email.com
ry_pg_utils-1.0.7/VERSION DELETED
@@ -1 +0,0 @@
1
- 1.0.7
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes