altcodepro-polydb-python 2.3.0__tar.gz → 2.3.2__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.3.0/src/altcodepro_polydb_python.egg-info → altcodepro_polydb_python-2.3.2}/PKG-INFO +3 -2
  2. {altcodepro_polydb_python-2.3.0 → altcodepro_polydb_python-2.3.2}/pyproject.toml +3 -2
  3. {altcodepro_polydb_python-2.3.0 → altcodepro_polydb_python-2.3.2/src/altcodepro_polydb_python.egg-info}/PKG-INFO +3 -2
  4. {altcodepro_polydb_python-2.3.0 → altcodepro_polydb_python-2.3.2}/src/altcodepro_polydb_python.egg-info/requires.txt +1 -0
  5. {altcodepro_polydb_python-2.3.0 → altcodepro_polydb_python-2.3.2}/src/polydb/adapters/AzureTableStorageAdapter.py +28 -10
  6. {altcodepro_polydb_python-2.3.0 → altcodepro_polydb_python-2.3.2}/LICENSE +0 -0
  7. {altcodepro_polydb_python-2.3.0 → altcodepro_polydb_python-2.3.2}/MANIFEST.in +0 -0
  8. {altcodepro_polydb_python-2.3.0 → altcodepro_polydb_python-2.3.2}/README.md +0 -0
  9. {altcodepro_polydb_python-2.3.0 → altcodepro_polydb_python-2.3.2}/example_usage.py +0 -0
  10. {altcodepro_polydb_python-2.3.0 → altcodepro_polydb_python-2.3.2}/requirements-aws.txt +0 -0
  11. {altcodepro_polydb_python-2.3.0 → altcodepro_polydb_python-2.3.2}/requirements-azure.txt +0 -0
  12. {altcodepro_polydb_python-2.3.0 → altcodepro_polydb_python-2.3.2}/requirements-dev.txt +0 -0
  13. {altcodepro_polydb_python-2.3.0 → altcodepro_polydb_python-2.3.2}/requirements-gcp.txt +0 -0
  14. {altcodepro_polydb_python-2.3.0 → altcodepro_polydb_python-2.3.2}/requirements-generic.txt +0 -0
  15. {altcodepro_polydb_python-2.3.0 → altcodepro_polydb_python-2.3.2}/requirements.txt +0 -0
  16. {altcodepro_polydb_python-2.3.0 → altcodepro_polydb_python-2.3.2}/setup.cfg +0 -0
  17. {altcodepro_polydb_python-2.3.0 → altcodepro_polydb_python-2.3.2}/setup.py +0 -0
  18. {altcodepro_polydb_python-2.3.0 → altcodepro_polydb_python-2.3.2}/src/altcodepro_polydb_python.egg-info/SOURCES.txt +0 -0
  19. {altcodepro_polydb_python-2.3.0 → altcodepro_polydb_python-2.3.2}/src/altcodepro_polydb_python.egg-info/dependency_links.txt +0 -0
  20. {altcodepro_polydb_python-2.3.0 → altcodepro_polydb_python-2.3.2}/src/altcodepro_polydb_python.egg-info/top_level.txt +0 -0
  21. {altcodepro_polydb_python-2.3.0 → altcodepro_polydb_python-2.3.2}/src/polydb/PolyDB.py +0 -0
  22. {altcodepro_polydb_python-2.3.0 → altcodepro_polydb_python-2.3.2}/src/polydb/__init__.py +0 -0
  23. {altcodepro_polydb_python-2.3.0 → altcodepro_polydb_python-2.3.2}/src/polydb/adapters/AzureBlobStorageAdapter.py +0 -0
  24. {altcodepro_polydb_python-2.3.0 → altcodepro_polydb_python-2.3.2}/src/polydb/adapters/AzureFileStorageAdapter.py +0 -0
  25. {altcodepro_polydb_python-2.3.0 → altcodepro_polydb_python-2.3.2}/src/polydb/adapters/AzureQueueAdapter.py +0 -0
  26. {altcodepro_polydb_python-2.3.0 → altcodepro_polydb_python-2.3.2}/src/polydb/adapters/BlockchainBlobAdapter.py +0 -0
  27. {altcodepro_polydb_python-2.3.0 → altcodepro_polydb_python-2.3.2}/src/polydb/adapters/BlockchainKVAdapter.py +0 -0
  28. {altcodepro_polydb_python-2.3.0 → altcodepro_polydb_python-2.3.2}/src/polydb/adapters/BlockchainQueueAdapter.py +0 -0
  29. {altcodepro_polydb_python-2.3.0 → altcodepro_polydb_python-2.3.2}/src/polydb/adapters/DynamoDBAdapter.py +0 -0
  30. {altcodepro_polydb_python-2.3.0 → altcodepro_polydb_python-2.3.2}/src/polydb/adapters/EFSAdapter.py +0 -0
  31. {altcodepro_polydb_python-2.3.0 → altcodepro_polydb_python-2.3.2}/src/polydb/adapters/FirestoreAdapter.py +0 -0
  32. {altcodepro_polydb_python-2.3.0 → altcodepro_polydb_python-2.3.2}/src/polydb/adapters/GCPPubSubAdapter.py +0 -0
  33. {altcodepro_polydb_python-2.3.0 → altcodepro_polydb_python-2.3.2}/src/polydb/adapters/GCPStorageAdapter.py +0 -0
  34. {altcodepro_polydb_python-2.3.0 → altcodepro_polydb_python-2.3.2}/src/polydb/adapters/MongoDBAdapter.py +0 -0
  35. {altcodepro_polydb_python-2.3.0 → altcodepro_polydb_python-2.3.2}/src/polydb/adapters/PostgreSQLAdapter.py +0 -0
  36. {altcodepro_polydb_python-2.3.0 → altcodepro_polydb_python-2.3.2}/src/polydb/adapters/S3Adapter.py +0 -0
  37. {altcodepro_polydb_python-2.3.0 → altcodepro_polydb_python-2.3.2}/src/polydb/adapters/S3CompatibleAdapter.py +0 -0
  38. {altcodepro_polydb_python-2.3.0 → altcodepro_polydb_python-2.3.2}/src/polydb/adapters/SQSAdapter.py +0 -0
  39. {altcodepro_polydb_python-2.3.0 → altcodepro_polydb_python-2.3.2}/src/polydb/adapters/VercelBlobAdapter.py +0 -0
  40. {altcodepro_polydb_python-2.3.0 → altcodepro_polydb_python-2.3.2}/src/polydb/adapters/VercelKVAdapter.py +0 -0
  41. {altcodepro_polydb_python-2.3.0 → altcodepro_polydb_python-2.3.2}/src/polydb/adapters/VercelQueueAdapter.py +0 -0
  42. {altcodepro_polydb_python-2.3.0 → altcodepro_polydb_python-2.3.2}/src/polydb/adapters/__init__.py +0 -0
  43. {altcodepro_polydb_python-2.3.0 → altcodepro_polydb_python-2.3.2}/src/polydb/advanced_query.py +0 -0
  44. {altcodepro_polydb_python-2.3.0 → altcodepro_polydb_python-2.3.2}/src/polydb/audit/AuditStorage.py +0 -0
  45. {altcodepro_polydb_python-2.3.0 → altcodepro_polydb_python-2.3.2}/src/polydb/audit/__init__.py +0 -0
  46. {altcodepro_polydb_python-2.3.0 → altcodepro_polydb_python-2.3.2}/src/polydb/audit/context.py +0 -0
  47. {altcodepro_polydb_python-2.3.0 → altcodepro_polydb_python-2.3.2}/src/polydb/audit/manager.py +0 -0
  48. {altcodepro_polydb_python-2.3.0 → altcodepro_polydb_python-2.3.2}/src/polydb/audit/models.py +0 -0
  49. {altcodepro_polydb_python-2.3.0 → altcodepro_polydb_python-2.3.2}/src/polydb/base/NoSQLKVAdapter.py +0 -0
  50. {altcodepro_polydb_python-2.3.0 → altcodepro_polydb_python-2.3.2}/src/polydb/base/ObjectStorageAdapter.py +0 -0
  51. {altcodepro_polydb_python-2.3.0 → altcodepro_polydb_python-2.3.2}/src/polydb/base/QueueAdapter.py +0 -0
  52. {altcodepro_polydb_python-2.3.0 → altcodepro_polydb_python-2.3.2}/src/polydb/base/SharedFilesAdapter.py +0 -0
  53. {altcodepro_polydb_python-2.3.0 → altcodepro_polydb_python-2.3.2}/src/polydb/base/__init__.py +0 -0
  54. {altcodepro_polydb_python-2.3.0 → altcodepro_polydb_python-2.3.2}/src/polydb/batch.py +0 -0
  55. {altcodepro_polydb_python-2.3.0 → altcodepro_polydb_python-2.3.2}/src/polydb/cache.py +0 -0
  56. {altcodepro_polydb_python-2.3.0 → altcodepro_polydb_python-2.3.2}/src/polydb/cloudDatabaseFactory.py +0 -0
  57. {altcodepro_polydb_python-2.3.0 → altcodepro_polydb_python-2.3.2}/src/polydb/databaseFactory.py +0 -0
  58. {altcodepro_polydb_python-2.3.0 → altcodepro_polydb_python-2.3.2}/src/polydb/decorators.py +0 -0
  59. {altcodepro_polydb_python-2.3.0 → altcodepro_polydb_python-2.3.2}/src/polydb/errors.py +0 -0
  60. {altcodepro_polydb_python-2.3.0 → altcodepro_polydb_python-2.3.2}/src/polydb/json_safe.py +0 -0
  61. {altcodepro_polydb_python-2.3.0 → altcodepro_polydb_python-2.3.2}/src/polydb/models.py +0 -0
  62. {altcodepro_polydb_python-2.3.0 → altcodepro_polydb_python-2.3.2}/src/polydb/monitoring.py +0 -0
  63. {altcodepro_polydb_python-2.3.0 → altcodepro_polydb_python-2.3.2}/src/polydb/multitenancy.py +0 -0
  64. {altcodepro_polydb_python-2.3.0 → altcodepro_polydb_python-2.3.2}/src/polydb/py.typed +0 -0
  65. {altcodepro_polydb_python-2.3.0 → altcodepro_polydb_python-2.3.2}/src/polydb/query.py +0 -0
  66. {altcodepro_polydb_python-2.3.0 → altcodepro_polydb_python-2.3.2}/src/polydb/registry.py +0 -0
  67. {altcodepro_polydb_python-2.3.0 → altcodepro_polydb_python-2.3.2}/src/polydb/retry.py +0 -0
  68. {altcodepro_polydb_python-2.3.0 → altcodepro_polydb_python-2.3.2}/src/polydb/schema.py +0 -0
  69. {altcodepro_polydb_python-2.3.0 → altcodepro_polydb_python-2.3.2}/src/polydb/security.py +0 -0
  70. {altcodepro_polydb_python-2.3.0 → altcodepro_polydb_python-2.3.2}/src/polydb/types.py +0 -0
  71. {altcodepro_polydb_python-2.3.0 → altcodepro_polydb_python-2.3.2}/src/polydb/utils.py +0 -0
  72. {altcodepro_polydb_python-2.3.0 → altcodepro_polydb_python-2.3.2}/src/polydb/validation.py +0 -0
  73. {altcodepro_polydb_python-2.3.0 → altcodepro_polydb_python-2.3.2}/tests/test_aws.py +0 -0
  74. {altcodepro_polydb_python-2.3.0 → altcodepro_polydb_python-2.3.2}/tests/test_azure.py +0 -0
  75. {altcodepro_polydb_python-2.3.0 → altcodepro_polydb_python-2.3.2}/tests/test_blockchain.py +0 -0
  76. {altcodepro_polydb_python-2.3.0 → altcodepro_polydb_python-2.3.2}/tests/test_cloud_factory.py +0 -0
  77. {altcodepro_polydb_python-2.3.0 → altcodepro_polydb_python-2.3.2}/tests/test_gcp.py +0 -0
  78. {altcodepro_polydb_python-2.3.0 → altcodepro_polydb_python-2.3.2}/tests/test_mongodb.py +0 -0
  79. {altcodepro_polydb_python-2.3.0 → altcodepro_polydb_python-2.3.2}/tests/test_multi_engine.py +0 -0
  80. {altcodepro_polydb_python-2.3.0 → altcodepro_polydb_python-2.3.2}/tests/test_postgresql.py +0 -0
  81. {altcodepro_polydb_python-2.3.0 → altcodepro_polydb_python-2.3.2}/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.3.0
3
+ Version: 2.3.2
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
@@ -20,13 +20,14 @@ Classifier: Programming Language :: Python :: 3.10
20
20
  Classifier: Programming Language :: Python :: 3.11
21
21
  Classifier: Programming Language :: Python :: 3.12
22
22
  Classifier: Operating System :: OS Independent
23
- Requires-Python: >=3.8
23
+ Requires-Python: >=3.11
24
24
  Description-Content-Type: text/markdown
25
25
  License-File: LICENSE
26
26
  Requires-Dist: psycopg2-binary>=2.9.11
27
27
  Requires-Dist: tenacity>=9.1.4
28
28
  Requires-Dist: redis>=6.4.0
29
29
  Requires-Dist: python-dotenv>=1.1.1
30
+ Requires-Dist: azure-storage-queue>=12.15.0
30
31
  Provides-Extra: aws
31
32
  Requires-Dist: boto3>=1.42.47; extra == "aws"
32
33
  Requires-Dist: botocore>=1.42.47; extra == "aws"
@@ -4,10 +4,10 @@ build-backend = "setuptools.build_meta"
4
4
 
5
5
  [project]
6
6
  name = "altcodepro-polydb-python"
7
- version = "2.3.0"
7
+ version = "2.3.2"
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
- requires-python = ">=3.8"
10
+ requires-python = ">=3.11"
11
11
  license-files = ["LICENSE"]
12
12
  authors = [{ name = "AltCodePro" }]
13
13
  keywords = [
@@ -46,6 +46,7 @@ dependencies = [
46
46
  "tenacity>=9.1.4",
47
47
  "redis>=6.4.0",
48
48
  "python-dotenv>=1.1.1",
49
+ "azure-storage-queue>=12.15.0",
49
50
  ]
50
51
 
51
52
  # Generic/Open-source stack (cheapest option)
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: altcodepro-polydb-python
3
- Version: 2.3.0
3
+ Version: 2.3.2
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
@@ -20,13 +20,14 @@ Classifier: Programming Language :: Python :: 3.10
20
20
  Classifier: Programming Language :: Python :: 3.11
21
21
  Classifier: Programming Language :: Python :: 3.12
22
22
  Classifier: Operating System :: OS Independent
23
- Requires-Python: >=3.8
23
+ Requires-Python: >=3.11
24
24
  Description-Content-Type: text/markdown
25
25
  License-File: LICENSE
26
26
  Requires-Dist: psycopg2-binary>=2.9.11
27
27
  Requires-Dist: tenacity>=9.1.4
28
28
  Requires-Dist: redis>=6.4.0
29
29
  Requires-Dist: python-dotenv>=1.1.1
30
+ Requires-Dist: azure-storage-queue>=12.15.0
30
31
  Provides-Extra: aws
31
32
  Requires-Dist: boto3>=1.42.47; extra == "aws"
32
33
  Requires-Dist: botocore>=1.42.47; extra == "aws"
@@ -2,6 +2,7 @@ psycopg2-binary>=2.9.11
2
2
  tenacity>=9.1.4
3
3
  redis>=6.4.0
4
4
  python-dotenv>=1.1.1
5
+ azure-storage-queue>=12.15.0
5
6
 
6
7
  [all]
7
8
  boto3>=1.42.47
@@ -19,7 +19,9 @@ from ..errors import NoSQLError, ConnectionError
19
19
  from ..retry import retry
20
20
  from ..types import JsonDict
21
21
  from ..models import PartitionConfig
22
+ import logging
22
23
 
24
+ logger = logging.getLogger(__name__)
23
25
 
24
26
  _BYTES_PREFIX = "@@polydb_bytes@@:"
25
27
  _JSON_PREFIX = "@@polydb_json@@:"
@@ -40,7 +42,7 @@ class AzureTableStorageAdapter(NoSQLKVAdapter):
40
42
  - Always returns id (derived from RowKey if missing)
41
43
  """
42
44
 
43
- AZURE_TABLE_MAX_SIZE = 1024 * 1024 # 1MB
45
+ AZURE_TABLE_MAX_SIZE = 60 * 1024 # 1MB
44
46
  _RESERVED = {"PartitionKey", "RowKey", "Timestamp", "etag", "ETag"}
45
47
 
46
48
  def __init__(
@@ -323,14 +325,28 @@ class AzureTableStorageAdapter(NoSQLKVAdapter):
323
325
 
324
326
  entity = self._pack_entity(model, safe_pk, safe_rk, data)
325
327
 
326
- size = self._entity_size_bytes(entity)
327
- if size > self.AZURE_TABLE_MAX_SIZE:
328
+ # === Check for any dangerously large property (64KB limit) ===
329
+ has_large_property = False
330
+ for key, value in entity.items():
331
+ if (
332
+ isinstance(value, str) and len(value.encode("utf-8")) > 60 * 1024
333
+ ): # 60KB safe margin
334
+ has_large_property = True
335
+ logger.info(
336
+ f"Large property detected: {key} ({len(value.encode('utf-8'))//1024} KB) → overflowing to Blob"
337
+ )
338
+ break
339
+
340
+ if has_large_property or self._entity_size_bytes(entity) > self.AZURE_TABLE_MAX_SIZE:
341
+ # Force full overflow to Blob
328
342
  full_payload_bytes = json.dumps(entity, default=json_safe).encode("utf-8")
329
343
  checksum = hashlib.md5(full_payload_bytes).hexdigest()
330
344
  blob_key = self._blob_key(safe_pk, safe_rk, checksum)
345
+
331
346
  self._blob_upload(blob_key, full_payload_bytes)
332
347
 
333
- reference_entity: JsonDict = {
348
+ # Create small reference record for Table
349
+ reference_entity = {
334
350
  "PartitionKey": safe_pk,
335
351
  "RowKey": safe_rk,
336
352
  _MODEL_FIELD: model.__qualname__,
@@ -341,20 +357,21 @@ class AzureTableStorageAdapter(NoSQLKVAdapter):
341
357
  "__keymap__": entity.get("__keymap__", "{}"),
342
358
  }
343
359
 
344
- # keep a small index of scalars for basic filtering
345
- kept = 0
360
+ # Keep a few small scalar fields for basic queries
346
361
  for k, v in entity.items():
347
362
  if k in ("PartitionKey", "RowKey", "__keymap__", _MODEL_FIELD):
348
363
  continue
349
364
  if k.startswith("_"):
350
365
  continue
351
- if v is None or isinstance(v, (str, bool, int, float, datetime)):
366
+ if (
367
+ v is None
368
+ or isinstance(v, (str, bool, int, float, datetime))
369
+ and len(str(v)) < 1000
370
+ ):
352
371
  reference_entity[k] = v
353
- kept += 1
354
- if kept >= 50:
355
- break
356
372
 
357
373
  self._table_client.upsert_entity(reference_entity)
374
+ logger.info(f"Entity overflowed to Blob: {blob_key}")
358
375
  return {
359
376
  "PartitionKey": safe_pk,
360
377
  "RowKey": safe_rk,
@@ -362,6 +379,7 @@ class AzureTableStorageAdapter(NoSQLKVAdapter):
362
379
  "id": safe_rk,
363
380
  }
364
381
 
382
+ # Normal small entity
365
383
  self._table_client.upsert_entity(entity)
366
384
  return {"PartitionKey": safe_pk, "RowKey": safe_rk, "id": safe_rk}
367
385