thoth-dbmanager 0.4.12__py3-none-any.whl → 0.4.13__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.
@@ -16,6 +16,7 @@ class DbPluginRegistry:
16
16
 
17
17
  _plugins: Dict[str, Type[DbPlugin]] = {}
18
18
  _instances: Dict[tuple, DbPlugin] = {} # Singleton instances
19
+ _registered_plugins: set = set() # Track already registered plugins to avoid spam
19
20
 
20
21
  @classmethod
21
22
  def register(cls, db_type: str, plugin_class: Type[DbPlugin]) -> None:
@@ -29,7 +30,15 @@ class DbPluginRegistry:
29
30
  if not issubclass(plugin_class, DbPlugin):
30
31
  raise TypeError(f"Plugin class {plugin_class.__name__} must inherit from DbPlugin")
31
32
 
33
+ # Check if plugin is already registered to avoid spam logs
34
+ plugin_key = f"{db_type}:{plugin_class.__name__}"
35
+ if plugin_key in cls._registered_plugins:
36
+ # Plugin already registered, don't log again
37
+ cls._plugins[db_type] = plugin_class
38
+ return
39
+
32
40
  cls._plugins[db_type] = plugin_class
41
+ cls._registered_plugins.add(plugin_key)
33
42
  logger.info(f"Registered plugin {plugin_class.__name__} for database type '{db_type}'")
34
43
 
35
44
  @classmethod
@@ -44,6 +53,10 @@ class DbPluginRegistry:
44
53
  plugin_class = cls._plugins.pop(db_type)
45
54
  logger.info(f"Unregistered plugin {plugin_class.__name__} for database type '{db_type}'")
46
55
 
56
+ # Remove from registered plugins set
57
+ plugin_key = f"{db_type}:{plugin_class.__name__}"
58
+ cls._registered_plugins.discard(plugin_key)
59
+
47
60
  # Remove any cached instances
48
61
  keys_to_remove = [key for key in cls._instances.keys() if key[0] == db_type]
49
62
  for key in keys_to_remove:
@@ -198,6 +211,7 @@ class DbPluginRegistry:
198
211
  """Clear the entire plugin registry."""
199
212
  cls._plugins.clear()
200
213
  cls._instances.clear()
214
+ cls._registered_plugins.clear()
201
215
  logger.info("Cleared plugin registry")
202
216
 
203
217
 
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: thoth_dbmanager
3
- Version: 0.4.12
3
+ Version: 0.4.13
4
4
  Summary: A Python library for managing SQL databases with support for multiple database types, LSH-based similarity search, and a modern plugin architecture.
5
5
  Author-email: Marco Pancotti <mp@tylconsulting.it>
6
6
  Project-URL: Homepage, https://github.com/mptyl/thoth_dbmanager
@@ -44,7 +44,7 @@ Requires-Dist: oracledb>=3.0.0; extra == "oracle"
44
44
  Provides-Extra: supabase
45
45
  Requires-Dist: supabase>=2.0.0; extra == "supabase"
46
46
  Requires-Dist: postgrest-py>=0.10.0; extra == "supabase"
47
- Requires-Dist: gotrue-py>=1.0.0; extra == "supabase"
47
+ Requires-Dist: gotrue>=1.0.0; extra == "supabase"
48
48
  Provides-Extra: sqlite
49
49
  Provides-Extra: all
50
50
  Requires-Dist: psycopg2-binary>=2.9.0; extra == "all"
@@ -13,7 +13,7 @@ thoth_dbmanager/adapters/supabase.py,sha256=bl2C6LpOpykPF3vIbdNRDk43aXLADzSk0wQu
13
13
  thoth_dbmanager/core/__init__.py,sha256=FlqNW0GZNv1rnwNgyXGzveLqaw0Z90y5AKhR_1DvHBE,269
14
14
  thoth_dbmanager/core/factory.py,sha256=sLj8tKI1ADqSlnU5F0NRtHHtpSimnATuwAqUYx5dfxI,9694
15
15
  thoth_dbmanager/core/interfaces.py,sha256=wZpKVQJdwMlAsHTQMB7yVviD2-N_dlOe19F-GhgEoGE,9576
16
- thoth_dbmanager/core/registry.py,sha256=2E9btPrPVnfI4z4JauKVEkN8mp8qy5gIVm3kKxUUD5E,7960
16
+ thoth_dbmanager/core/registry.py,sha256=url4qpQMoMw4rDrdAAvV6L7-NdO4z86xSJPSwTH_l5g,8624
17
17
  thoth_dbmanager/helpers/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
18
18
  thoth_dbmanager/helpers/multi_db_generator.py,sha256=LOrWEqh-RTVZXPF7vrlF6BmBGh1XC09kM6XkqkFNPQ4,23232
19
19
  thoth_dbmanager/helpers/preprocess_values.py,sha256=sKMjD50UL2CZG7-g7KGe3TJQeXmXC7n28LGge8CaP5c,6183
@@ -32,8 +32,8 @@ thoth_dbmanager/plugins/postgresql.py,sha256=pI1W9oHpQty8tHMoEDcsOT-Msv6S4aoFcAr
32
32
  thoth_dbmanager/plugins/sqlite.py,sha256=ATWubLiLBL04Xjk24oUcZP5rQhksDZVfCwySrLRekiY,8654
33
33
  thoth_dbmanager/plugins/sqlserver.py,sha256=mMb3F5FmSWV02FZwj-Ult-2TjuyeVA4Fl1iME1dbgLU,5289
34
34
  thoth_dbmanager/plugins/supabase.py,sha256=mWlaGAdpywx4-pU4Ffpmn24ze8sg0sM5kc6bFDoeYRg,8645
35
- thoth_dbmanager-0.4.12.dist-info/licenses/LICENSE,sha256=81-BOzGgwtY1XdYfkwMQB87AkOGXI9OMq0kjNcZA4UE,1071
36
- thoth_dbmanager-0.4.12.dist-info/METADATA,sha256=gT0cJyyrAYIKSdJWb8fzB-V6SZ-4FF3wss3o4E7jgHE,12247
37
- thoth_dbmanager-0.4.12.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
38
- thoth_dbmanager-0.4.12.dist-info/top_level.txt,sha256=b9ttxm9RUc0KUCASEKRx6FqoREYJ1-KZWSpNuaM0uQ4,16
39
- thoth_dbmanager-0.4.12.dist-info/RECORD,,
35
+ thoth_dbmanager-0.4.13.dist-info/licenses/LICENSE,sha256=81-BOzGgwtY1XdYfkwMQB87AkOGXI9OMq0kjNcZA4UE,1071
36
+ thoth_dbmanager-0.4.13.dist-info/METADATA,sha256=o6GwJni4Cm_Mt4KveZ2QlbYX6Kc4felT5wOx6Ojopso,12244
37
+ thoth_dbmanager-0.4.13.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
38
+ thoth_dbmanager-0.4.13.dist-info/top_level.txt,sha256=b9ttxm9RUc0KUCASEKRx6FqoREYJ1-KZWSpNuaM0uQ4,16
39
+ thoth_dbmanager-0.4.13.dist-info/RECORD,,