altcodepro-polydb-python 2.2.4__tar.gz → 2.2.5__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 (81) hide show
  1. {altcodepro_polydb_python-2.2.4/src/altcodepro_polydb_python.egg-info → altcodepro_polydb_python-2.2.5}/PKG-INFO +1 -1
  2. {altcodepro_polydb_python-2.2.4 → altcodepro_polydb_python-2.2.5}/pyproject.toml +1 -1
  3. {altcodepro_polydb_python-2.2.4 → altcodepro_polydb_python-2.2.5/src/altcodepro_polydb_python.egg-info}/PKG-INFO +1 -1
  4. {altcodepro_polydb_python-2.2.4 → altcodepro_polydb_python-2.2.5}/src/altcodepro_polydb_python.egg-info/SOURCES.txt +1 -0
  5. altcodepro_polydb_python-2.2.5/src/polydb/base/DataAccessRuntime.py +101 -0
  6. {altcodepro_polydb_python-2.2.4 → altcodepro_polydb_python-2.2.5}/src/polydb/base/NoSQLKVAdapter.py +5 -1
  7. {altcodepro_polydb_python-2.2.4 → altcodepro_polydb_python-2.2.5}/src/polydb/cloudDatabaseFactory.py +26 -2
  8. {altcodepro_polydb_python-2.2.4 → altcodepro_polydb_python-2.2.5}/LICENSE +0 -0
  9. {altcodepro_polydb_python-2.2.4 → altcodepro_polydb_python-2.2.5}/MANIFEST.in +0 -0
  10. {altcodepro_polydb_python-2.2.4 → altcodepro_polydb_python-2.2.5}/README.md +0 -0
  11. {altcodepro_polydb_python-2.2.4 → altcodepro_polydb_python-2.2.5}/example_usage.py +0 -0
  12. {altcodepro_polydb_python-2.2.4 → altcodepro_polydb_python-2.2.5}/requirements-aws.txt +0 -0
  13. {altcodepro_polydb_python-2.2.4 → altcodepro_polydb_python-2.2.5}/requirements-azure.txt +0 -0
  14. {altcodepro_polydb_python-2.2.4 → altcodepro_polydb_python-2.2.5}/requirements-dev.txt +0 -0
  15. {altcodepro_polydb_python-2.2.4 → altcodepro_polydb_python-2.2.5}/requirements-gcp.txt +0 -0
  16. {altcodepro_polydb_python-2.2.4 → altcodepro_polydb_python-2.2.5}/requirements-generic.txt +0 -0
  17. {altcodepro_polydb_python-2.2.4 → altcodepro_polydb_python-2.2.5}/requirements.txt +0 -0
  18. {altcodepro_polydb_python-2.2.4 → altcodepro_polydb_python-2.2.5}/setup.cfg +0 -0
  19. {altcodepro_polydb_python-2.2.4 → altcodepro_polydb_python-2.2.5}/setup.py +0 -0
  20. {altcodepro_polydb_python-2.2.4 → altcodepro_polydb_python-2.2.5}/src/altcodepro_polydb_python.egg-info/dependency_links.txt +0 -0
  21. {altcodepro_polydb_python-2.2.4 → altcodepro_polydb_python-2.2.5}/src/altcodepro_polydb_python.egg-info/requires.txt +0 -0
  22. {altcodepro_polydb_python-2.2.4 → altcodepro_polydb_python-2.2.5}/src/altcodepro_polydb_python.egg-info/top_level.txt +0 -0
  23. {altcodepro_polydb_python-2.2.4 → altcodepro_polydb_python-2.2.5}/src/polydb/__init__.py +0 -0
  24. {altcodepro_polydb_python-2.2.4 → altcodepro_polydb_python-2.2.5}/src/polydb/adapters/AzureBlobStorageAdapter.py +0 -0
  25. {altcodepro_polydb_python-2.2.4 → altcodepro_polydb_python-2.2.5}/src/polydb/adapters/AzureFileStorageAdapter.py +0 -0
  26. {altcodepro_polydb_python-2.2.4 → altcodepro_polydb_python-2.2.5}/src/polydb/adapters/AzureQueueAdapter.py +0 -0
  27. {altcodepro_polydb_python-2.2.4 → altcodepro_polydb_python-2.2.5}/src/polydb/adapters/AzureTableStorageAdapter.py +0 -0
  28. {altcodepro_polydb_python-2.2.4 → altcodepro_polydb_python-2.2.5}/src/polydb/adapters/BlockchainBlobAdapter.py +0 -0
  29. {altcodepro_polydb_python-2.2.4 → altcodepro_polydb_python-2.2.5}/src/polydb/adapters/BlockchainKVAdapter.py +0 -0
  30. {altcodepro_polydb_python-2.2.4 → altcodepro_polydb_python-2.2.5}/src/polydb/adapters/BlockchainQueueAdapter.py +0 -0
  31. {altcodepro_polydb_python-2.2.4 → altcodepro_polydb_python-2.2.5}/src/polydb/adapters/DynamoDBAdapter.py +0 -0
  32. {altcodepro_polydb_python-2.2.4 → altcodepro_polydb_python-2.2.5}/src/polydb/adapters/EFSAdapter.py +0 -0
  33. {altcodepro_polydb_python-2.2.4 → altcodepro_polydb_python-2.2.5}/src/polydb/adapters/FirestoreAdapter.py +0 -0
  34. {altcodepro_polydb_python-2.2.4 → altcodepro_polydb_python-2.2.5}/src/polydb/adapters/GCPPubSubAdapter.py +0 -0
  35. {altcodepro_polydb_python-2.2.4 → altcodepro_polydb_python-2.2.5}/src/polydb/adapters/GCPStorageAdapter.py +0 -0
  36. {altcodepro_polydb_python-2.2.4 → altcodepro_polydb_python-2.2.5}/src/polydb/adapters/MongoDBAdapter.py +0 -0
  37. {altcodepro_polydb_python-2.2.4 → altcodepro_polydb_python-2.2.5}/src/polydb/adapters/PostgreSQLAdapter.py +0 -0
  38. {altcodepro_polydb_python-2.2.4 → altcodepro_polydb_python-2.2.5}/src/polydb/adapters/S3Adapter.py +0 -0
  39. {altcodepro_polydb_python-2.2.4 → altcodepro_polydb_python-2.2.5}/src/polydb/adapters/S3CompatibleAdapter.py +0 -0
  40. {altcodepro_polydb_python-2.2.4 → altcodepro_polydb_python-2.2.5}/src/polydb/adapters/SQSAdapter.py +0 -0
  41. {altcodepro_polydb_python-2.2.4 → altcodepro_polydb_python-2.2.5}/src/polydb/adapters/VercelBlobAdapter.py +0 -0
  42. {altcodepro_polydb_python-2.2.4 → altcodepro_polydb_python-2.2.5}/src/polydb/adapters/VercelKVAdapter.py +0 -0
  43. {altcodepro_polydb_python-2.2.4 → altcodepro_polydb_python-2.2.5}/src/polydb/adapters/VercelQueueAdapter.py +0 -0
  44. {altcodepro_polydb_python-2.2.4 → altcodepro_polydb_python-2.2.5}/src/polydb/adapters/__init__.py +0 -0
  45. {altcodepro_polydb_python-2.2.4 → altcodepro_polydb_python-2.2.5}/src/polydb/advanced_query.py +0 -0
  46. {altcodepro_polydb_python-2.2.4 → altcodepro_polydb_python-2.2.5}/src/polydb/audit/AuditStorage.py +0 -0
  47. {altcodepro_polydb_python-2.2.4 → altcodepro_polydb_python-2.2.5}/src/polydb/audit/__init__.py +0 -0
  48. {altcodepro_polydb_python-2.2.4 → altcodepro_polydb_python-2.2.5}/src/polydb/audit/context.py +0 -0
  49. {altcodepro_polydb_python-2.2.4 → altcodepro_polydb_python-2.2.5}/src/polydb/audit/manager.py +0 -0
  50. {altcodepro_polydb_python-2.2.4 → altcodepro_polydb_python-2.2.5}/src/polydb/audit/models.py +0 -0
  51. {altcodepro_polydb_python-2.2.4 → altcodepro_polydb_python-2.2.5}/src/polydb/base/ObjectStorageAdapter.py +0 -0
  52. {altcodepro_polydb_python-2.2.4 → altcodepro_polydb_python-2.2.5}/src/polydb/base/QueueAdapter.py +0 -0
  53. {altcodepro_polydb_python-2.2.4 → altcodepro_polydb_python-2.2.5}/src/polydb/base/SharedFilesAdapter.py +0 -0
  54. {altcodepro_polydb_python-2.2.4 → altcodepro_polydb_python-2.2.5}/src/polydb/base/__init__.py +0 -0
  55. {altcodepro_polydb_python-2.2.4 → altcodepro_polydb_python-2.2.5}/src/polydb/batch.py +0 -0
  56. {altcodepro_polydb_python-2.2.4 → altcodepro_polydb_python-2.2.5}/src/polydb/cache.py +0 -0
  57. {altcodepro_polydb_python-2.2.4 → altcodepro_polydb_python-2.2.5}/src/polydb/databaseFactory.py +0 -0
  58. {altcodepro_polydb_python-2.2.4 → altcodepro_polydb_python-2.2.5}/src/polydb/decorators.py +0 -0
  59. {altcodepro_polydb_python-2.2.4 → altcodepro_polydb_python-2.2.5}/src/polydb/errors.py +0 -0
  60. {altcodepro_polydb_python-2.2.4 → altcodepro_polydb_python-2.2.5}/src/polydb/json_safe.py +0 -0
  61. {altcodepro_polydb_python-2.2.4 → altcodepro_polydb_python-2.2.5}/src/polydb/models.py +0 -0
  62. {altcodepro_polydb_python-2.2.4 → altcodepro_polydb_python-2.2.5}/src/polydb/monitoring.py +0 -0
  63. {altcodepro_polydb_python-2.2.4 → altcodepro_polydb_python-2.2.5}/src/polydb/multitenancy.py +0 -0
  64. {altcodepro_polydb_python-2.2.4 → altcodepro_polydb_python-2.2.5}/src/polydb/py.typed +0 -0
  65. {altcodepro_polydb_python-2.2.4 → altcodepro_polydb_python-2.2.5}/src/polydb/query.py +0 -0
  66. {altcodepro_polydb_python-2.2.4 → altcodepro_polydb_python-2.2.5}/src/polydb/registry.py +0 -0
  67. {altcodepro_polydb_python-2.2.4 → altcodepro_polydb_python-2.2.5}/src/polydb/retry.py +0 -0
  68. {altcodepro_polydb_python-2.2.4 → altcodepro_polydb_python-2.2.5}/src/polydb/schema.py +0 -0
  69. {altcodepro_polydb_python-2.2.4 → altcodepro_polydb_python-2.2.5}/src/polydb/security.py +0 -0
  70. {altcodepro_polydb_python-2.2.4 → altcodepro_polydb_python-2.2.5}/src/polydb/types.py +0 -0
  71. {altcodepro_polydb_python-2.2.4 → altcodepro_polydb_python-2.2.5}/src/polydb/utils.py +0 -0
  72. {altcodepro_polydb_python-2.2.4 → altcodepro_polydb_python-2.2.5}/src/polydb/validation.py +0 -0
  73. {altcodepro_polydb_python-2.2.4 → altcodepro_polydb_python-2.2.5}/tests/test_aws.py +0 -0
  74. {altcodepro_polydb_python-2.2.4 → altcodepro_polydb_python-2.2.5}/tests/test_azure.py +0 -0
  75. {altcodepro_polydb_python-2.2.4 → altcodepro_polydb_python-2.2.5}/tests/test_blockchain.py +0 -0
  76. {altcodepro_polydb_python-2.2.4 → altcodepro_polydb_python-2.2.5}/tests/test_cloud_factory.py +0 -0
  77. {altcodepro_polydb_python-2.2.4 → altcodepro_polydb_python-2.2.5}/tests/test_gcp.py +0 -0
  78. {altcodepro_polydb_python-2.2.4 → altcodepro_polydb_python-2.2.5}/tests/test_mongodb.py +0 -0
  79. {altcodepro_polydb_python-2.2.4 → altcodepro_polydb_python-2.2.5}/tests/test_multi_engine.py +0 -0
  80. {altcodepro_polydb_python-2.2.4 → altcodepro_polydb_python-2.2.5}/tests/test_postgresql.py +0 -0
  81. {altcodepro_polydb_python-2.2.4 → altcodepro_polydb_python-2.2.5}/tests/test_vercel.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: altcodepro-polydb-python
3
- Version: 2.2.4
3
+ Version: 2.2.5
4
4
  Summary: Production-ready multi-cloud database abstraction layer with connection pooling, retry logic, and thread safety
5
5
  Author: AltCodePro
6
6
  Project-URL: Homepage, https://github.com/altcodepro/polydb-python
@@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"
4
4
 
5
5
  [project]
6
6
  name = "altcodepro-polydb-python"
7
- version = "2.2.4"
7
+ version = "2.2.5"
8
8
  description = "Production-ready multi-cloud database abstraction layer with connection pooling, retry logic, and thread safety"
9
9
  readme = { file = "README.md", content-type = "text/markdown" }
10
10
  requires-python = ">=3.8"
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: altcodepro-polydb-python
3
- Version: 2.2.4
3
+ Version: 2.2.5
4
4
  Summary: Production-ready multi-cloud database abstraction layer with connection pooling, retry logic, and thread safety
5
5
  Author: AltCodePro
6
6
  Project-URL: Homepage, https://github.com/altcodepro/polydb-python
@@ -62,6 +62,7 @@ src/polydb/audit/__init__.py
62
62
  src/polydb/audit/context.py
63
63
  src/polydb/audit/manager.py
64
64
  src/polydb/audit/models.py
65
+ src/polydb/base/DataAccessRuntime.py
65
66
  src/polydb/base/NoSQLKVAdapter.py
66
67
  src/polydb/base/ObjectStorageAdapter.py
67
68
  src/polydb/base/QueueAdapter.py
@@ -0,0 +1,101 @@
1
+ from typing import Protocol, Any, Dict, List, Optional, Tuple, Union
2
+
3
+
4
+ # -------------------------------
5
+ # SQL ADAPTER CONTRACT
6
+ # -------------------------------
7
+ class SQLAdapter(Protocol):
8
+ def insert(self, table: str, data: Dict[str, Any]) -> Dict[str, Any]: ...
9
+ def select(
10
+ self,
11
+ table: str,
12
+ query: Dict[str, Any],
13
+ limit: Optional[int] = None,
14
+ offset: Optional[int] = None,
15
+ ) -> List[Dict[str, Any]]: ...
16
+ def select_page(
17
+ self, table: str, query: Dict[str, Any], page_size: int, continuation_token: Optional[str]
18
+ ) -> Tuple[List[Dict[str, Any]], Optional[str]]: ...
19
+ def update(self, table: str, entity_id: Any, data: Dict[str, Any]) -> Dict[str, Any]: ...
20
+ def delete(self, table: str, entity_id: Any) -> Dict[str, Any]: ...
21
+ def upsert(self, table: str, data: Dict[str, Any]) -> Dict[str, Any]: ...
22
+ def query_linq(self, table: str, builder: Any) -> Union[List[Dict[str, Any]], int]: ...
23
+ def execute(self, sql: str, params: Optional[List[Any]] = None) -> Any: ...
24
+
25
+
26
+ # -------------------------------
27
+ # NOSQL ADAPTER CONTRACT
28
+ # -------------------------------
29
+ class NoSQLAdapter(Protocol):
30
+ def put(self, model: type, data: Dict[str, Any]) -> Dict[str, Any]: ...
31
+ def query(
32
+ self, model: type, query: Dict[str, Any], limit: Optional[int] = None
33
+ ) -> List[Dict[str, Any]]: ...
34
+ def query_page(
35
+ self, model: type, query: Dict[str, Any], page_size: int, continuation_token: Optional[str]
36
+ ) -> Tuple[List[Dict[str, Any]], Optional[str]]: ...
37
+ def patch(self, model: type, entity_id: Any, data: Dict[str, Any]) -> Dict[str, Any]: ...
38
+ def delete(self, model: type, entity_id: Any) -> Dict[str, Any]: ...
39
+ def upsert(self, model: type, data: Dict[str, Any]) -> Dict[str, Any]: ...
40
+ def query_linq(self, model: type, builder: Any) -> Union[List[Dict[str, Any]], int]: ...
41
+
42
+
43
+ # -------------------------------
44
+ # OBJECT STORAGE
45
+ # -------------------------------
46
+ class ObjectStorage(Protocol):
47
+ def put(self, key: str, data: bytes, **kwargs) -> str: ...
48
+ def get(self, key: str) -> Optional[bytes]: ...
49
+ def delete(self, key: str) -> bool: ...
50
+ def list(self, prefix: str = "") -> List[str]: ...
51
+
52
+
53
+ # -------------------------------
54
+ # QUEUE (FIXED)
55
+ # -------------------------------
56
+ class QueueService(Protocol):
57
+ def publish(
58
+ self, queue_name: str, message: Dict[str, Any], delay: Optional[int] = None
59
+ ) -> None: ...
60
+ def consume(
61
+ self, queue_name: str, max_messages: int, wait_seconds: int
62
+ ) -> List[Dict[str, Any]]: ...
63
+ def ack(self, queue_name: str, receipt_handle: str) -> None: ...
64
+ def nack(self, queue_name: str, receipt_handle: str, delay: Optional[int] = None) -> None: ...
65
+
66
+
67
+ # -------------------------------
68
+ # CACHE
69
+ # -------------------------------
70
+ class CacheService(Protocol):
71
+ def set(self, key: str, value: Any, ttl: int) -> None: ...
72
+ def get(self, key: str) -> Optional[Any]: ...
73
+ def delete(self, key: str) -> None: ...
74
+
75
+
76
+ # -------------------------------
77
+ # FINAL RUNTIME CONTRACT
78
+ # -------------------------------
79
+ class DataAccessRuntime(Protocol):
80
+
81
+ # high-level CRUD (used by UDL)
82
+ def create(self, model: Any, data: Dict[str, Any]) -> Dict[str, Any]: ...
83
+ def read(
84
+ self,
85
+ model: Any,
86
+ query: Dict[str, Any],
87
+ limit: Optional[int] = None,
88
+ offset: Optional[int] = None,
89
+ ) -> List[Dict[str, Any]]: ...
90
+ def read_one(self, model: Any, query: Dict[str, Any]) -> Optional[Dict[str, Any]]: ...
91
+ def update(self, model: Any, entity_id: Any, data: Dict[str, Any]) -> Dict[str, Any]: ...
92
+ def delete(self, model: Any, entity_id: Any) -> Any: ...
93
+ def upsert(self, model: Any, data: Dict[str, Any]) -> Dict[str, Any]: ...
94
+ def query_linq(self, model: Any, builder: Any) -> Union[List[Dict[str, Any]], int]: ...
95
+
96
+ # adapters (CRITICAL)
97
+ def get_sql(self) -> SQLAdapter: ...
98
+ def get_nosql_kv(self) -> NoSQLAdapter: ...
99
+ def get_object_storage(self) -> ObjectStorage: ...
100
+ def get_queue(self) -> QueueService: ...
101
+ def get_cache(self) -> CacheService: ...
@@ -6,6 +6,7 @@ import json
6
6
  import threading
7
7
  from typing import Any, Dict, List, Optional, Tuple, Union, TYPE_CHECKING, cast
8
8
 
9
+
9
10
  from ..json_safe import json_safe
10
11
 
11
12
  from ..errors import NoSQLError, StorageError
@@ -20,7 +21,10 @@ if TYPE_CHECKING:
20
21
  class NoSQLKVAdapter:
21
22
  """Base with auto-overflow and LINQ support"""
22
23
 
23
- def __init__(self, partition_config: Optional[PartitionConfig] = None):
24
+ def __init__(
25
+ self,
26
+ partition_config: Optional[PartitionConfig] = None,
27
+ ):
24
28
  from ..utils import setup_logger
25
29
 
26
30
  self.logger = setup_logger(self.__class__.__name__)
@@ -4,6 +4,13 @@ import os
4
4
  import threading
5
5
  from typing import Dict, List, Optional
6
6
 
7
+ from .adapters.PostgreSQLAdapter import PostgreSQLAdapter
8
+ from .adapters.AzureBlobStorageAdapter import AzureBlobStorageAdapter
9
+ from .adapters.BlockchainBlobAdapter import BlockchainBlobAdapter
10
+ from .adapters.GCPStorageAdapter import GCPStorageAdapter
11
+ from .adapters.S3CompatibleAdapter import S3CompatibleAdapter
12
+ from .adapters.VercelBlobAdapter import VercelBlobAdapter
13
+
7
14
  from .models import (
8
15
  AzureStorageConfig,
9
16
  BlockchainStorageConfig,
@@ -46,7 +53,15 @@ class CloudDatabaseFactory:
46
53
  for cfg in storage_configs:
47
54
  self.configs[cfg.name] = cfg
48
55
 
49
- self.instances: Dict[str, object] = {}
56
+ self.instances: Dict[
57
+ str,
58
+ PostgreSQLAdapter
59
+ | AzureBlobStorageAdapter
60
+ | S3CompatibleAdapter
61
+ | GCPStorageAdapter
62
+ | VercelBlobAdapter
63
+ | BlockchainBlobAdapter,
64
+ ] = {}
50
65
  self._lock = threading.Lock()
51
66
 
52
67
  self.logger.info(f"Factory initialized (default provider={self.provider.value})")
@@ -76,7 +91,16 @@ class CloudDatabaseFactory:
76
91
  # --------------------------------------------------------
77
92
  # OBJECT STORAGE
78
93
  # --------------------------------------------------------
79
- def get_object_storage(self, name: str = "default"):
94
+ def get_object_storage(
95
+ self, name: str = "default"
96
+ ) -> (
97
+ PostgreSQLAdapter
98
+ | AzureBlobStorageAdapter
99
+ | S3CompatibleAdapter
100
+ | GCPStorageAdapter
101
+ | VercelBlobAdapter
102
+ | BlockchainBlobAdapter
103
+ ):
80
104
  with self._lock:
81
105
  if name in self.instances:
82
106
  return self.instances[name]