altcodepro-polydb-python 2.5.1__tar.gz → 2.5.3__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 (101) hide show
  1. {altcodepro_polydb_python-2.5.1/src/altcodepro_polydb_python.egg-info → altcodepro_polydb_python-2.5.3}/PKG-INFO +1 -1
  2. {altcodepro_polydb_python-2.5.1 → altcodepro_polydb_python-2.5.3}/pyproject.toml +1 -1
  3. {altcodepro_polydb_python-2.5.1 → altcodepro_polydb_python-2.5.3/src/altcodepro_polydb_python.egg-info}/PKG-INFO +1 -1
  4. {altcodepro_polydb_python-2.5.1 → altcodepro_polydb_python-2.5.3}/src/polydb/adapters/AzureTableStorageAdapter.py +14 -4
  5. {altcodepro_polydb_python-2.5.1 → altcodepro_polydb_python-2.5.3}/src/polydb/adapters/MongoDBAdapter.py +32 -11
  6. {altcodepro_polydb_python-2.5.1 → altcodepro_polydb_python-2.5.3}/LICENSE +0 -0
  7. {altcodepro_polydb_python-2.5.1 → altcodepro_polydb_python-2.5.3}/MANIFEST.in +0 -0
  8. {altcodepro_polydb_python-2.5.1 → altcodepro_polydb_python-2.5.3}/README.md +0 -0
  9. {altcodepro_polydb_python-2.5.1 → altcodepro_polydb_python-2.5.3}/requirements-aws.txt +0 -0
  10. {altcodepro_polydb_python-2.5.1 → altcodepro_polydb_python-2.5.3}/requirements-azure.txt +0 -0
  11. {altcodepro_polydb_python-2.5.1 → altcodepro_polydb_python-2.5.3}/requirements-dev.txt +0 -0
  12. {altcodepro_polydb_python-2.5.1 → altcodepro_polydb_python-2.5.3}/requirements-gcp.txt +0 -0
  13. {altcodepro_polydb_python-2.5.1 → altcodepro_polydb_python-2.5.3}/requirements-generic.txt +0 -0
  14. {altcodepro_polydb_python-2.5.1 → altcodepro_polydb_python-2.5.3}/requirements.txt +0 -0
  15. {altcodepro_polydb_python-2.5.1 → altcodepro_polydb_python-2.5.3}/setup.cfg +0 -0
  16. {altcodepro_polydb_python-2.5.1 → altcodepro_polydb_python-2.5.3}/setup.py +0 -0
  17. {altcodepro_polydb_python-2.5.1 → altcodepro_polydb_python-2.5.3}/src/altcodepro_polydb_python.egg-info/SOURCES.txt +0 -0
  18. {altcodepro_polydb_python-2.5.1 → altcodepro_polydb_python-2.5.3}/src/altcodepro_polydb_python.egg-info/dependency_links.txt +0 -0
  19. {altcodepro_polydb_python-2.5.1 → altcodepro_polydb_python-2.5.3}/src/altcodepro_polydb_python.egg-info/requires.txt +0 -0
  20. {altcodepro_polydb_python-2.5.1 → altcodepro_polydb_python-2.5.3}/src/altcodepro_polydb_python.egg-info/top_level.txt +0 -0
  21. {altcodepro_polydb_python-2.5.1 → altcodepro_polydb_python-2.5.3}/src/polydb/PolyDB.py +0 -0
  22. {altcodepro_polydb_python-2.5.1 → altcodepro_polydb_python-2.5.3}/src/polydb/__init__.py +0 -0
  23. {altcodepro_polydb_python-2.5.1 → altcodepro_polydb_python-2.5.3}/src/polydb/adapters/AzureBlobStorageAdapter.py +0 -0
  24. {altcodepro_polydb_python-2.5.1 → altcodepro_polydb_python-2.5.3}/src/polydb/adapters/AzureFileStorageAdapter.py +0 -0
  25. {altcodepro_polydb_python-2.5.1 → altcodepro_polydb_python-2.5.3}/src/polydb/adapters/AzureQueueAdapter.py +0 -0
  26. {altcodepro_polydb_python-2.5.1 → altcodepro_polydb_python-2.5.3}/src/polydb/adapters/BlockchainBlobAdapter.py +0 -0
  27. {altcodepro_polydb_python-2.5.1 → altcodepro_polydb_python-2.5.3}/src/polydb/adapters/BlockchainFileAdapter.py +0 -0
  28. {altcodepro_polydb_python-2.5.1 → altcodepro_polydb_python-2.5.3}/src/polydb/adapters/BlockchainKVAdapter.py +0 -0
  29. {altcodepro_polydb_python-2.5.1 → altcodepro_polydb_python-2.5.3}/src/polydb/adapters/BlockchainQueueAdapter.py +0 -0
  30. {altcodepro_polydb_python-2.5.1 → altcodepro_polydb_python-2.5.3}/src/polydb/adapters/DynamoDBAdapter.py +0 -0
  31. {altcodepro_polydb_python-2.5.1 → altcodepro_polydb_python-2.5.3}/src/polydb/adapters/EFSAdapter.py +0 -0
  32. {altcodepro_polydb_python-2.5.1 → altcodepro_polydb_python-2.5.3}/src/polydb/adapters/FirestoreAdapter.py +0 -0
  33. {altcodepro_polydb_python-2.5.1 → altcodepro_polydb_python-2.5.3}/src/polydb/adapters/GCPFilestoreAdapter.py +0 -0
  34. {altcodepro_polydb_python-2.5.1 → altcodepro_polydb_python-2.5.3}/src/polydb/adapters/GCPPubSubAdapter.py +0 -0
  35. {altcodepro_polydb_python-2.5.1 → altcodepro_polydb_python-2.5.3}/src/polydb/adapters/GCPStorageAdapter.py +0 -0
  36. {altcodepro_polydb_python-2.5.1 → altcodepro_polydb_python-2.5.3}/src/polydb/adapters/PostgreSQLAdapter.py +0 -0
  37. {altcodepro_polydb_python-2.5.1 → altcodepro_polydb_python-2.5.3}/src/polydb/adapters/S3Adapter.py +0 -0
  38. {altcodepro_polydb_python-2.5.1 → altcodepro_polydb_python-2.5.3}/src/polydb/adapters/S3CompatibleAdapter.py +0 -0
  39. {altcodepro_polydb_python-2.5.1 → altcodepro_polydb_python-2.5.3}/src/polydb/adapters/SQSAdapter.py +0 -0
  40. {altcodepro_polydb_python-2.5.1 → altcodepro_polydb_python-2.5.3}/src/polydb/adapters/VercelBlobAdapter.py +0 -0
  41. {altcodepro_polydb_python-2.5.1 → altcodepro_polydb_python-2.5.3}/src/polydb/adapters/VercelFileAdapter.py +0 -0
  42. {altcodepro_polydb_python-2.5.1 → altcodepro_polydb_python-2.5.3}/src/polydb/adapters/VercelKVAdapter.py +0 -0
  43. {altcodepro_polydb_python-2.5.1 → altcodepro_polydb_python-2.5.3}/src/polydb/adapters/VercelQueueAdapter.py +0 -0
  44. {altcodepro_polydb_python-2.5.1 → altcodepro_polydb_python-2.5.3}/src/polydb/adapters/__init__.py +0 -0
  45. {altcodepro_polydb_python-2.5.1 → altcodepro_polydb_python-2.5.3}/src/polydb/advanced_query.py +0 -0
  46. {altcodepro_polydb_python-2.5.1 → altcodepro_polydb_python-2.5.3}/src/polydb/audit/AuditStorage.py +0 -0
  47. {altcodepro_polydb_python-2.5.1 → altcodepro_polydb_python-2.5.3}/src/polydb/audit/__init__.py +0 -0
  48. {altcodepro_polydb_python-2.5.1 → altcodepro_polydb_python-2.5.3}/src/polydb/audit/context.py +0 -0
  49. {altcodepro_polydb_python-2.5.1 → altcodepro_polydb_python-2.5.3}/src/polydb/audit/manager.py +0 -0
  50. {altcodepro_polydb_python-2.5.1 → altcodepro_polydb_python-2.5.3}/src/polydb/audit/models.py +0 -0
  51. {altcodepro_polydb_python-2.5.1 → altcodepro_polydb_python-2.5.3}/src/polydb/base/NoSQLKVAdapter.py +0 -0
  52. {altcodepro_polydb_python-2.5.1 → altcodepro_polydb_python-2.5.3}/src/polydb/base/ObjectStorageAdapter.py +0 -0
  53. {altcodepro_polydb_python-2.5.1 → altcodepro_polydb_python-2.5.3}/src/polydb/base/QueueAdapter.py +0 -0
  54. {altcodepro_polydb_python-2.5.1 → altcodepro_polydb_python-2.5.3}/src/polydb/base/SharedFilesAdapter.py +0 -0
  55. {altcodepro_polydb_python-2.5.1 → altcodepro_polydb_python-2.5.3}/src/polydb/base/__init__.py +0 -0
  56. {altcodepro_polydb_python-2.5.1 → altcodepro_polydb_python-2.5.3}/src/polydb/batch.py +0 -0
  57. {altcodepro_polydb_python-2.5.1 → altcodepro_polydb_python-2.5.3}/src/polydb/cache.py +0 -0
  58. {altcodepro_polydb_python-2.5.1 → altcodepro_polydb_python-2.5.3}/src/polydb/cloudDatabaseFactory.py +0 -0
  59. {altcodepro_polydb_python-2.5.1 → altcodepro_polydb_python-2.5.3}/src/polydb/databaseFactory.py +0 -0
  60. {altcodepro_polydb_python-2.5.1 → altcodepro_polydb_python-2.5.3}/src/polydb/decorators.py +0 -0
  61. {altcodepro_polydb_python-2.5.1 → altcodepro_polydb_python-2.5.3}/src/polydb/errors.py +0 -0
  62. {altcodepro_polydb_python-2.5.1 → altcodepro_polydb_python-2.5.3}/src/polydb/json_safe.py +0 -0
  63. {altcodepro_polydb_python-2.5.1 → altcodepro_polydb_python-2.5.3}/src/polydb/models.py +0 -0
  64. {altcodepro_polydb_python-2.5.1 → altcodepro_polydb_python-2.5.3}/src/polydb/monitoring.py +0 -0
  65. {altcodepro_polydb_python-2.5.1 → altcodepro_polydb_python-2.5.3}/src/polydb/multitenancy.py +0 -0
  66. {altcodepro_polydb_python-2.5.1 → altcodepro_polydb_python-2.5.3}/src/polydb/observability/__init__.py +0 -0
  67. {altcodepro_polydb_python-2.5.1 → altcodepro_polydb_python-2.5.3}/src/polydb/observability/logging.py +0 -0
  68. {altcodepro_polydb_python-2.5.1 → altcodepro_polydb_python-2.5.3}/src/polydb/py.typed +0 -0
  69. {altcodepro_polydb_python-2.5.1 → altcodepro_polydb_python-2.5.3}/src/polydb/query.py +0 -0
  70. {altcodepro_polydb_python-2.5.1 → altcodepro_polydb_python-2.5.3}/src/polydb/registry.py +0 -0
  71. {altcodepro_polydb_python-2.5.1 → altcodepro_polydb_python-2.5.3}/src/polydb/retry.py +0 -0
  72. {altcodepro_polydb_python-2.5.1 → altcodepro_polydb_python-2.5.3}/src/polydb/schema.py +0 -0
  73. {altcodepro_polydb_python-2.5.1 → altcodepro_polydb_python-2.5.3}/src/polydb/security.py +0 -0
  74. {altcodepro_polydb_python-2.5.1 → altcodepro_polydb_python-2.5.3}/src/polydb/services/__init__.py +0 -0
  75. {altcodepro_polydb_python-2.5.1 → altcodepro_polydb_python-2.5.3}/src/polydb/services/compliance_service.py +0 -0
  76. {altcodepro_polydb_python-2.5.1 → altcodepro_polydb_python-2.5.3}/src/polydb/services/security_service.py +0 -0
  77. {altcodepro_polydb_python-2.5.1 → altcodepro_polydb_python-2.5.3}/src/polydb/types.py +0 -0
  78. {altcodepro_polydb_python-2.5.1 → altcodepro_polydb_python-2.5.3}/src/polydb/utils.py +0 -0
  79. {altcodepro_polydb_python-2.5.1 → altcodepro_polydb_python-2.5.3}/src/polydb/validation.py +0 -0
  80. {altcodepro_polydb_python-2.5.1 → altcodepro_polydb_python-2.5.3}/tests/test_advanced_query_injection.py +0 -0
  81. {altcodepro_polydb_python-2.5.1 → altcodepro_polydb_python-2.5.3}/tests/test_atomic_decrement.py +0 -0
  82. {altcodepro_polydb_python-2.5.1 → altcodepro_polydb_python-2.5.3}/tests/test_audit_chain_cutover.py +0 -0
  83. {altcodepro_polydb_python-2.5.1 → altcodepro_polydb_python-2.5.3}/tests/test_audit_hmac.py +0 -0
  84. {altcodepro_polydb_python-2.5.1 → altcodepro_polydb_python-2.5.3}/tests/test_aws.py +0 -0
  85. {altcodepro_polydb_python-2.5.1 → altcodepro_polydb_python-2.5.3}/tests/test_azure.py +0 -0
  86. {altcodepro_polydb_python-2.5.1 → altcodepro_polydb_python-2.5.3}/tests/test_azure_queue_receipt_handle.py +0 -0
  87. {altcodepro_polydb_python-2.5.1 → altcodepro_polydb_python-2.5.3}/tests/test_azure_table_empty_filter.py +0 -0
  88. {altcodepro_polydb_python-2.5.1 → altcodepro_polydb_python-2.5.3}/tests/test_azure_table_unpack_entity.py +0 -0
  89. {altcodepro_polydb_python-2.5.1 → altcodepro_polydb_python-2.5.3}/tests/test_blockchain.py +0 -0
  90. {altcodepro_polydb_python-2.5.1 → altcodepro_polydb_python-2.5.3}/tests/test_cloud_factory.py +0 -0
  91. {altcodepro_polydb_python-2.5.1 → altcodepro_polydb_python-2.5.3}/tests/test_field_encryption.py +0 -0
  92. {altcodepro_polydb_python-2.5.1 → altcodepro_polydb_python-2.5.3}/tests/test_gcp.py +0 -0
  93. {altcodepro_polydb_python-2.5.1 → altcodepro_polydb_python-2.5.3}/tests/test_like_pattern_escaping.py +0 -0
  94. {altcodepro_polydb_python-2.5.1 → altcodepro_polydb_python-2.5.3}/tests/test_mongodb.py +0 -0
  95. {altcodepro_polydb_python-2.5.1 → altcodepro_polydb_python-2.5.3}/tests/test_multi_engine.py +0 -0
  96. {altcodepro_polydb_python-2.5.1 → altcodepro_polydb_python-2.5.3}/tests/test_multitenancy_ddl_injection.py +0 -0
  97. {altcodepro_polydb_python-2.5.1 → altcodepro_polydb_python-2.5.3}/tests/test_nosql_operator_injection.py +0 -0
  98. {altcodepro_polydb_python-2.5.1 → altcodepro_polydb_python-2.5.3}/tests/test_observability.py +0 -0
  99. {altcodepro_polydb_python-2.5.1 → altcodepro_polydb_python-2.5.3}/tests/test_postgresql.py +0 -0
  100. {altcodepro_polydb_python-2.5.1 → altcodepro_polydb_python-2.5.3}/tests/test_schema_ddl_injection.py +0 -0
  101. {altcodepro_polydb_python-2.5.1 → altcodepro_polydb_python-2.5.3}/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.5.1
3
+ Version: 2.5.3
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.5.1"
7
+ version = "2.5.3"
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.11"
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: altcodepro-polydb-python
3
- Version: 2.5.1
3
+ Version: 2.5.3
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,7 +20,7 @@ from ..json_safe import json_safe
20
20
  from ..errors import NoSQLError, ConnectionError
21
21
  from ..retry import retry
22
22
  from ..types import JsonDict
23
- from ..models import PartitionConfig
23
+ from ..models import PageResult, PartitionConfig
24
24
 
25
25
  logger = logging.getLogger(__name__)
26
26
 
@@ -155,7 +155,16 @@ class AzureTableStorageAdapter(NoSQLKVAdapter):
155
155
 
156
156
  if isinstance(v, datetime):
157
157
  return v
158
-
158
+ if isinstance(v, int):
159
+ # Azure Table Int32 range: -2_147_483_648 … 2_147_483_647
160
+ if -2_147_483_648 <= v <= 2_147_483_647:
161
+ return v
162
+ # Outside Int32 → force Int64-compatible representation
163
+ # The Azure SDK accepts Python ints larger than Int32 and stores them as Edm.Int64
164
+ # when they fit in 64 bits. For values that exceed even Int64 we fall back to string.
165
+ if -9_223_372_036_854_775_808 <= v <= 9_223_372_036_854_775_807:
166
+ return v # will be stored as Edm.Int64
167
+ return str(v) # safety net for arbitrarily large ints
159
168
  if isinstance(v, (str, bool, int, float)):
160
169
  return v
161
170
 
@@ -164,14 +173,14 @@ class AzureTableStorageAdapter(NoSQLKVAdapter):
164
173
  def _decode_value(self, v: Any) -> Any:
165
174
  if isinstance(v, str):
166
175
  if v.startswith(_JSON_PREFIX):
167
- payload = v[len(_JSON_PREFIX):]
176
+ payload = v[len(_JSON_PREFIX) :]
168
177
  try:
169
178
  return json.loads(payload)
170
179
  except Exception:
171
180
  return v
172
181
 
173
182
  if v.startswith(_BYTES_PREFIX):
174
- payload = v[len(_BYTES_PREFIX):].strip()
183
+ payload = v[len(_BYTES_PREFIX) :].strip()
175
184
  if (len(payload) % 4) == 1:
176
185
  return v
177
186
  if not _BASE64_RE.match(payload):
@@ -646,6 +655,7 @@ class AzureTableStorageAdapter(NoSQLKVAdapter):
646
655
  @property
647
656
  def capabilities(self):
648
657
  from ..models import BackendCapabilities
658
+
649
659
  return BackendCapabilities(
650
660
  server_order=False,
651
661
  server_filter=True,
@@ -134,6 +134,34 @@ class MongoDBAdapter(NoSQLKVAdapter):
134
134
  finally:
135
135
  self._indexed_collections.add(collection_name)
136
136
 
137
+ # -----------------------------------------------------
138
+ # Internal <-> domain field mapping
139
+ # -----------------------------------------------------
140
+
141
+ def _finalize_doc(self, model: type, doc: JsonDict) -> JsonDict:
142
+ """
143
+ Strip PolyDB's internal _pk/_rk storage keys before returning a
144
+ record, mapping each back to the domain field it was derived from
145
+ (the model's declared partition_key/sort_key) -- mirrors
146
+ AzureTableStorageAdapter._unpack_entity, which already does this
147
+ for PartitionKey/RowKey. Without it, callers see raw storage-
148
+ internal column names instead of their own schema's field names.
149
+ Guarded with setdefault so a real stored property never gets
150
+ clobbered by the derived value.
151
+ """
152
+ pk_field, rk_field = self._pk_rk_field_names(model)
153
+ pk_val = doc.pop("_pk", None)
154
+ rk_val = doc.pop("_rk", None)
155
+
156
+ if pk_val is not None:
157
+ doc.setdefault(pk_field, pk_val)
158
+ if rk_val is not None:
159
+ doc.setdefault(rk_field, rk_val)
160
+
161
+ doc.setdefault("id", rk_val)
162
+
163
+ return doc
164
+
137
165
  # -----------------------------------------------------
138
166
  # PUT
139
167
  # -----------------------------------------------------
@@ -158,11 +186,7 @@ class MongoDBAdapter(NoSQLKVAdapter):
158
186
  )
159
187
 
160
188
  # return full stored row (tests expect this)
161
- result = dict(payload)
162
- result.pop("_pk", None)
163
- result.pop("_rk", None)
164
-
165
- return result
189
+ return self._finalize_doc(model, dict(payload))
166
190
 
167
191
  except Exception as e:
168
192
  raise NoSQLError(f"MongoDB put failed: {e}")
@@ -182,9 +206,8 @@ class MongoDBAdapter(NoSQLKVAdapter):
182
206
  return None
183
207
 
184
208
  doc.pop("_id", None)
185
- doc.setdefault("id", rk)
186
209
 
187
- return doc
210
+ return self._finalize_doc(model, doc)
188
211
 
189
212
  except Exception as e:
190
213
  raise NoSQLError(f"MongoDB get failed: {e}")
@@ -215,8 +238,7 @@ class MongoDBAdapter(NoSQLKVAdapter):
215
238
 
216
239
  for doc in cursor:
217
240
  doc.pop("_id", None)
218
- doc.setdefault("id", doc.get("_rk"))
219
- rows.append(doc)
241
+ rows.append(self._finalize_doc(model, doc))
220
242
 
221
243
  if not rows:
222
244
  return [], None
@@ -283,8 +305,7 @@ class MongoDBAdapter(NoSQLKVAdapter):
283
305
 
284
306
  for doc in cursor:
285
307
  doc.pop("_id", None)
286
- doc.setdefault("id", doc.get("_rk"))
287
- results.append(doc)
308
+ results.append(self._finalize_doc(model, doc))
288
309
 
289
310
  return results
290
311