altcodepro-polydb-python 2.3.6__tar.gz → 2.3.7__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.
- {altcodepro_polydb_python-2.3.6/src/altcodepro_polydb_python.egg-info → altcodepro_polydb_python-2.3.7}/PKG-INFO +1 -1
- {altcodepro_polydb_python-2.3.6 → altcodepro_polydb_python-2.3.7}/pyproject.toml +1 -1
- {altcodepro_polydb_python-2.3.6 → altcodepro_polydb_python-2.3.7/src/altcodepro_polydb_python.egg-info}/PKG-INFO +1 -1
- {altcodepro_polydb_python-2.3.6 → altcodepro_polydb_python-2.3.7}/src/polydb/adapters/AzureTableStorageAdapter.py +65 -91
- {altcodepro_polydb_python-2.3.6 → altcodepro_polydb_python-2.3.7}/src/polydb/base/NoSQLKVAdapter.py +4 -5
- {altcodepro_polydb_python-2.3.6 → altcodepro_polydb_python-2.3.7}/LICENSE +0 -0
- {altcodepro_polydb_python-2.3.6 → altcodepro_polydb_python-2.3.7}/MANIFEST.in +0 -0
- {altcodepro_polydb_python-2.3.6 → altcodepro_polydb_python-2.3.7}/README.md +0 -0
- {altcodepro_polydb_python-2.3.6 → altcodepro_polydb_python-2.3.7}/example_usage.py +0 -0
- {altcodepro_polydb_python-2.3.6 → altcodepro_polydb_python-2.3.7}/requirements-aws.txt +0 -0
- {altcodepro_polydb_python-2.3.6 → altcodepro_polydb_python-2.3.7}/requirements-azure.txt +0 -0
- {altcodepro_polydb_python-2.3.6 → altcodepro_polydb_python-2.3.7}/requirements-dev.txt +0 -0
- {altcodepro_polydb_python-2.3.6 → altcodepro_polydb_python-2.3.7}/requirements-gcp.txt +0 -0
- {altcodepro_polydb_python-2.3.6 → altcodepro_polydb_python-2.3.7}/requirements-generic.txt +0 -0
- {altcodepro_polydb_python-2.3.6 → altcodepro_polydb_python-2.3.7}/requirements.txt +0 -0
- {altcodepro_polydb_python-2.3.6 → altcodepro_polydb_python-2.3.7}/setup.cfg +0 -0
- {altcodepro_polydb_python-2.3.6 → altcodepro_polydb_python-2.3.7}/setup.py +0 -0
- {altcodepro_polydb_python-2.3.6 → altcodepro_polydb_python-2.3.7}/src/altcodepro_polydb_python.egg-info/SOURCES.txt +0 -0
- {altcodepro_polydb_python-2.3.6 → altcodepro_polydb_python-2.3.7}/src/altcodepro_polydb_python.egg-info/dependency_links.txt +0 -0
- {altcodepro_polydb_python-2.3.6 → altcodepro_polydb_python-2.3.7}/src/altcodepro_polydb_python.egg-info/requires.txt +0 -0
- {altcodepro_polydb_python-2.3.6 → altcodepro_polydb_python-2.3.7}/src/altcodepro_polydb_python.egg-info/top_level.txt +0 -0
- {altcodepro_polydb_python-2.3.6 → altcodepro_polydb_python-2.3.7}/src/polydb/PolyDB.py +0 -0
- {altcodepro_polydb_python-2.3.6 → altcodepro_polydb_python-2.3.7}/src/polydb/__init__.py +0 -0
- {altcodepro_polydb_python-2.3.6 → altcodepro_polydb_python-2.3.7}/src/polydb/adapters/AzureBlobStorageAdapter.py +0 -0
- {altcodepro_polydb_python-2.3.6 → altcodepro_polydb_python-2.3.7}/src/polydb/adapters/AzureFileStorageAdapter.py +0 -0
- {altcodepro_polydb_python-2.3.6 → altcodepro_polydb_python-2.3.7}/src/polydb/adapters/AzureQueueAdapter.py +0 -0
- {altcodepro_polydb_python-2.3.6 → altcodepro_polydb_python-2.3.7}/src/polydb/adapters/BlockchainBlobAdapter.py +0 -0
- {altcodepro_polydb_python-2.3.6 → altcodepro_polydb_python-2.3.7}/src/polydb/adapters/BlockchainKVAdapter.py +0 -0
- {altcodepro_polydb_python-2.3.6 → altcodepro_polydb_python-2.3.7}/src/polydb/adapters/BlockchainQueueAdapter.py +0 -0
- {altcodepro_polydb_python-2.3.6 → altcodepro_polydb_python-2.3.7}/src/polydb/adapters/DynamoDBAdapter.py +0 -0
- {altcodepro_polydb_python-2.3.6 → altcodepro_polydb_python-2.3.7}/src/polydb/adapters/EFSAdapter.py +0 -0
- {altcodepro_polydb_python-2.3.6 → altcodepro_polydb_python-2.3.7}/src/polydb/adapters/FirestoreAdapter.py +0 -0
- {altcodepro_polydb_python-2.3.6 → altcodepro_polydb_python-2.3.7}/src/polydb/adapters/GCPPubSubAdapter.py +0 -0
- {altcodepro_polydb_python-2.3.6 → altcodepro_polydb_python-2.3.7}/src/polydb/adapters/GCPStorageAdapter.py +0 -0
- {altcodepro_polydb_python-2.3.6 → altcodepro_polydb_python-2.3.7}/src/polydb/adapters/MongoDBAdapter.py +0 -0
- {altcodepro_polydb_python-2.3.6 → altcodepro_polydb_python-2.3.7}/src/polydb/adapters/PostgreSQLAdapter.py +0 -0
- {altcodepro_polydb_python-2.3.6 → altcodepro_polydb_python-2.3.7}/src/polydb/adapters/S3Adapter.py +0 -0
- {altcodepro_polydb_python-2.3.6 → altcodepro_polydb_python-2.3.7}/src/polydb/adapters/S3CompatibleAdapter.py +0 -0
- {altcodepro_polydb_python-2.3.6 → altcodepro_polydb_python-2.3.7}/src/polydb/adapters/SQSAdapter.py +0 -0
- {altcodepro_polydb_python-2.3.6 → altcodepro_polydb_python-2.3.7}/src/polydb/adapters/VercelBlobAdapter.py +0 -0
- {altcodepro_polydb_python-2.3.6 → altcodepro_polydb_python-2.3.7}/src/polydb/adapters/VercelKVAdapter.py +0 -0
- {altcodepro_polydb_python-2.3.6 → altcodepro_polydb_python-2.3.7}/src/polydb/adapters/VercelQueueAdapter.py +0 -0
- {altcodepro_polydb_python-2.3.6 → altcodepro_polydb_python-2.3.7}/src/polydb/adapters/__init__.py +0 -0
- {altcodepro_polydb_python-2.3.6 → altcodepro_polydb_python-2.3.7}/src/polydb/advanced_query.py +0 -0
- {altcodepro_polydb_python-2.3.6 → altcodepro_polydb_python-2.3.7}/src/polydb/audit/AuditStorage.py +0 -0
- {altcodepro_polydb_python-2.3.6 → altcodepro_polydb_python-2.3.7}/src/polydb/audit/__init__.py +0 -0
- {altcodepro_polydb_python-2.3.6 → altcodepro_polydb_python-2.3.7}/src/polydb/audit/context.py +0 -0
- {altcodepro_polydb_python-2.3.6 → altcodepro_polydb_python-2.3.7}/src/polydb/audit/manager.py +0 -0
- {altcodepro_polydb_python-2.3.6 → altcodepro_polydb_python-2.3.7}/src/polydb/audit/models.py +0 -0
- {altcodepro_polydb_python-2.3.6 → altcodepro_polydb_python-2.3.7}/src/polydb/base/ObjectStorageAdapter.py +0 -0
- {altcodepro_polydb_python-2.3.6 → altcodepro_polydb_python-2.3.7}/src/polydb/base/QueueAdapter.py +0 -0
- {altcodepro_polydb_python-2.3.6 → altcodepro_polydb_python-2.3.7}/src/polydb/base/SharedFilesAdapter.py +0 -0
- {altcodepro_polydb_python-2.3.6 → altcodepro_polydb_python-2.3.7}/src/polydb/base/__init__.py +0 -0
- {altcodepro_polydb_python-2.3.6 → altcodepro_polydb_python-2.3.7}/src/polydb/batch.py +0 -0
- {altcodepro_polydb_python-2.3.6 → altcodepro_polydb_python-2.3.7}/src/polydb/cache.py +0 -0
- {altcodepro_polydb_python-2.3.6 → altcodepro_polydb_python-2.3.7}/src/polydb/cloudDatabaseFactory.py +0 -0
- {altcodepro_polydb_python-2.3.6 → altcodepro_polydb_python-2.3.7}/src/polydb/databaseFactory.py +0 -0
- {altcodepro_polydb_python-2.3.6 → altcodepro_polydb_python-2.3.7}/src/polydb/decorators.py +0 -0
- {altcodepro_polydb_python-2.3.6 → altcodepro_polydb_python-2.3.7}/src/polydb/errors.py +0 -0
- {altcodepro_polydb_python-2.3.6 → altcodepro_polydb_python-2.3.7}/src/polydb/json_safe.py +0 -0
- {altcodepro_polydb_python-2.3.6 → altcodepro_polydb_python-2.3.7}/src/polydb/models.py +0 -0
- {altcodepro_polydb_python-2.3.6 → altcodepro_polydb_python-2.3.7}/src/polydb/monitoring.py +0 -0
- {altcodepro_polydb_python-2.3.6 → altcodepro_polydb_python-2.3.7}/src/polydb/multitenancy.py +0 -0
- {altcodepro_polydb_python-2.3.6 → altcodepro_polydb_python-2.3.7}/src/polydb/py.typed +0 -0
- {altcodepro_polydb_python-2.3.6 → altcodepro_polydb_python-2.3.7}/src/polydb/query.py +0 -0
- {altcodepro_polydb_python-2.3.6 → altcodepro_polydb_python-2.3.7}/src/polydb/registry.py +0 -0
- {altcodepro_polydb_python-2.3.6 → altcodepro_polydb_python-2.3.7}/src/polydb/retry.py +0 -0
- {altcodepro_polydb_python-2.3.6 → altcodepro_polydb_python-2.3.7}/src/polydb/schema.py +0 -0
- {altcodepro_polydb_python-2.3.6 → altcodepro_polydb_python-2.3.7}/src/polydb/security.py +0 -0
- {altcodepro_polydb_python-2.3.6 → altcodepro_polydb_python-2.3.7}/src/polydb/types.py +0 -0
- {altcodepro_polydb_python-2.3.6 → altcodepro_polydb_python-2.3.7}/src/polydb/utils.py +0 -0
- {altcodepro_polydb_python-2.3.6 → altcodepro_polydb_python-2.3.7}/src/polydb/validation.py +0 -0
- {altcodepro_polydb_python-2.3.6 → altcodepro_polydb_python-2.3.7}/tests/test_aws.py +0 -0
- {altcodepro_polydb_python-2.3.6 → altcodepro_polydb_python-2.3.7}/tests/test_azure.py +0 -0
- {altcodepro_polydb_python-2.3.6 → altcodepro_polydb_python-2.3.7}/tests/test_blockchain.py +0 -0
- {altcodepro_polydb_python-2.3.6 → altcodepro_polydb_python-2.3.7}/tests/test_cloud_factory.py +0 -0
- {altcodepro_polydb_python-2.3.6 → altcodepro_polydb_python-2.3.7}/tests/test_gcp.py +0 -0
- {altcodepro_polydb_python-2.3.6 → altcodepro_polydb_python-2.3.7}/tests/test_mongodb.py +0 -0
- {altcodepro_polydb_python-2.3.6 → altcodepro_polydb_python-2.3.7}/tests/test_multi_engine.py +0 -0
- {altcodepro_polydb_python-2.3.6 → altcodepro_polydb_python-2.3.7}/tests/test_postgresql.py +0 -0
- {altcodepro_polydb_python-2.3.6 → altcodepro_polydb_python-2.3.7}/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.
|
|
3
|
+
Version: 2.3.7
|
|
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.3.
|
|
7
|
+
version = "2.3.7"
|
|
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.3.
|
|
3
|
+
Version: 2.3.7
|
|
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
|
|
@@ -30,6 +30,8 @@ _BASE64_RE = re.compile(r"^[A-Za-z0-9+/]*={0,2}$")
|
|
|
30
30
|
# ensures model isolation across the same table
|
|
31
31
|
_MODEL_FIELD = "__polydb_model__"
|
|
32
32
|
|
|
33
|
+
logging.getLogger("azure").setLevel(logging.ERROR)
|
|
34
|
+
|
|
33
35
|
|
|
34
36
|
class AzureTableStorageAdapter(NoSQLKVAdapter):
|
|
35
37
|
"""
|
|
@@ -199,33 +201,46 @@ class AzureTableStorageAdapter(NoSQLKVAdapter):
|
|
|
199
201
|
# -----------------------------
|
|
200
202
|
# Entity pack/unpack
|
|
201
203
|
# -----------------------------
|
|
202
|
-
|
|
203
204
|
def _pack_entity(self, model: type, pk: str, rk: str, data: JsonDict) -> JsonDict:
|
|
204
|
-
|
|
205
|
+
"""Pack data into Azure Table Storage entity format.
|
|
205
206
|
|
|
207
|
+
This version is much simpler, more readable, and fixes the fragile
|
|
208
|
+
revmap/skey logic that was likely causing normal fields to disappear.
|
|
209
|
+
"""
|
|
210
|
+
entity: JsonDict = {
|
|
211
|
+
"PartitionKey": pk,
|
|
212
|
+
"RowKey": rk,
|
|
213
|
+
}
|
|
206
214
|
entity[_MODEL_FIELD] = model.__qualname__
|
|
207
|
-
|
|
208
215
|
keymap: Dict[str, str] = {}
|
|
209
|
-
revmap: Dict[str, str] = {}
|
|
210
216
|
|
|
211
217
|
for orig_key, orig_val in (data or {}).items():
|
|
212
|
-
|
|
218
|
+
orig_key_str = str(orig_key)
|
|
219
|
+
|
|
220
|
+
# Skip Azure-reserved or special keys
|
|
221
|
+
if orig_key_str in self._RESERVED or orig_key_str in ("PartitionKey", "RowKey"):
|
|
213
222
|
continue
|
|
214
223
|
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
keymap[skey] = str(orig_key)
|
|
224
|
+
# Sanitize property name so it is valid for Azure Table Storage
|
|
225
|
+
skey = self._sanitize_prop_name(orig_key)
|
|
226
|
+
|
|
227
|
+
# Prevent key collisions (extremely rare but safe)
|
|
228
|
+
base = skey
|
|
229
|
+
counter = 1
|
|
230
|
+
while skey in entity:
|
|
231
|
+
skey = f"{base}_{counter}"
|
|
232
|
+
counter += 1
|
|
225
233
|
|
|
234
|
+
# Remember the original key name so _unpack_entity can restore it
|
|
235
|
+
keymap[skey] = orig_key_str
|
|
236
|
+
|
|
237
|
+
# Encode the value (must return something Azure Table accepts)
|
|
226
238
|
entity[skey] = self._encode_value(orig_val)
|
|
227
239
|
|
|
228
|
-
|
|
240
|
+
# Store keymap only if we actually have fields (internal use)
|
|
241
|
+
if keymap:
|
|
242
|
+
entity["__keymap__"] = json.dumps(keymap, default=json_safe)
|
|
243
|
+
|
|
229
244
|
return entity
|
|
230
245
|
|
|
231
246
|
def _unpack_entity(self, entity: JsonDict) -> JsonDict:
|
|
@@ -380,96 +395,55 @@ class AzureTableStorageAdapter(NoSQLKVAdapter):
|
|
|
380
395
|
self._table_client = self._get_table_client(model)
|
|
381
396
|
safe_pk = self._sanitize_pk_rk(pk)
|
|
382
397
|
safe_rk = self._sanitize_pk_rk(rk)
|
|
383
|
-
|
|
384
398
|
# Pack entity (encoded for Azure Table)
|
|
385
399
|
entity = self._pack_entity(model, safe_pk, safe_rk, data)
|
|
386
|
-
|
|
387
400
|
# ---------------------------------------------------
|
|
388
401
|
# SIZE ESTIMATION (use ORIGINAL payload, not packed)
|
|
389
402
|
# ---------------------------------------------------
|
|
390
403
|
MAX_PROPERTY_CHARS = 30 * 1024 # ~30K safe under UTF-16 32K limit
|
|
391
|
-
MAX_ENTITY_SIZE = 40 * 1024 # conservative total threshold
|
|
392
404
|
|
|
393
405
|
def _is_large_string(val: Any) -> bool:
|
|
394
406
|
return isinstance(val, str) and len(val) > MAX_PROPERTY_CHARS
|
|
395
407
|
|
|
396
|
-
|
|
397
|
-
large_key = None
|
|
398
|
-
|
|
408
|
+
large_val_dict = {}
|
|
399
409
|
for key, value in entity.items():
|
|
400
410
|
if _is_large_string(value):
|
|
401
|
-
has_large_property = True
|
|
402
|
-
large_key = key
|
|
403
411
|
logger.warning(
|
|
404
412
|
f"LARGE PROPERTY DETECTED: {key} length={len(value)} chars → forcing blob overflow"
|
|
405
413
|
)
|
|
406
|
-
|
|
407
|
-
|
|
408
|
-
|
|
409
|
-
|
|
410
|
-
|
|
411
|
-
|
|
412
|
-
|
|
413
|
-
|
|
414
|
-
|
|
415
|
-
|
|
416
|
-
|
|
417
|
-
|
|
418
|
-
|
|
419
|
-
|
|
420
|
-
|
|
421
|
-
|
|
422
|
-
|
|
423
|
-
|
|
424
|
-
|
|
425
|
-
|
|
426
|
-
|
|
427
|
-
|
|
428
|
-
|
|
429
|
-
|
|
430
|
-
|
|
431
|
-
|
|
432
|
-
|
|
433
|
-
|
|
434
|
-
|
|
435
|
-
|
|
436
|
-
"_size": payload_size,
|
|
437
|
-
"_checksum": checksum,
|
|
438
|
-
"__keymap__": entity.get("__keymap__", "{}"),
|
|
439
|
-
}
|
|
440
|
-
|
|
441
|
-
# Keep only small queryable fields
|
|
442
|
-
for k, v in entity.items():
|
|
443
|
-
if k in ("PartitionKey", "RowKey", "__keymap__", _MODEL_FIELD):
|
|
444
|
-
continue
|
|
445
|
-
if k.startswith("_"):
|
|
446
|
-
continue
|
|
447
|
-
|
|
448
|
-
if isinstance(v, (str, bool, int, float)):
|
|
449
|
-
if isinstance(v, str) and len(v) > 2000:
|
|
450
|
-
continue
|
|
451
|
-
reference_entity[k] = v
|
|
452
|
-
|
|
453
|
-
elif isinstance(v, datetime):
|
|
454
|
-
reference_entity[k] = v
|
|
455
|
-
self._table_client = self._get_table_client(model)
|
|
456
|
-
self._table_client.upsert_entity(reference_entity)
|
|
457
|
-
|
|
458
|
-
logger.info(f"Stored in blob: {blob_key} ({payload_size // 1024} KB)")
|
|
459
|
-
|
|
460
|
-
restored = self._unpack_entity(entity)
|
|
461
|
-
restored["_overflow"] = True
|
|
462
|
-
restored["_blob_key"] = blob_key
|
|
463
|
-
restored["_checksum"] = checksum
|
|
464
|
-
restored["_size"] = payload_size
|
|
465
|
-
restored["id"] = safe_rk
|
|
466
|
-
|
|
467
|
-
return restored
|
|
414
|
+
payload_json = json.dumps(value, default=json_safe)
|
|
415
|
+
payload_bytes = payload_json.encode("utf-8")
|
|
416
|
+
payload_size = len(payload_bytes)
|
|
417
|
+
checksum = hashlib.md5(payload_bytes).hexdigest()
|
|
418
|
+
val_key = self._sanitize_blob_part(key)
|
|
419
|
+
blob_key = self._blob_key(f"{safe_pk}_{safe_rk}", val_key, checksum)
|
|
420
|
+
self._blob_upload(blob_key, payload_bytes)
|
|
421
|
+
logger.info(f"Stored in blob: {blob_key} ({payload_size // 1024} KB)")
|
|
422
|
+
large_val_dict[key] = {
|
|
423
|
+
"PartitionKey": safe_pk,
|
|
424
|
+
"RowKey": safe_rk,
|
|
425
|
+
_MODEL_FIELD: model.__qualname__,
|
|
426
|
+
"_overflow": True,
|
|
427
|
+
"_blob_key": blob_key,
|
|
428
|
+
"_size": payload_size,
|
|
429
|
+
"_checksum": checksum,
|
|
430
|
+
}
|
|
431
|
+
|
|
432
|
+
reference_entity = {
|
|
433
|
+
_MODEL_FIELD: model.__qualname__,
|
|
434
|
+
}
|
|
435
|
+
for k, v in entity.items():
|
|
436
|
+
if k.startswith("_"):
|
|
437
|
+
continue
|
|
438
|
+
if k in large_val_dict:
|
|
439
|
+
metadata = large_val_dict[k]
|
|
440
|
+
reference_entity[k] = json.dumps(metadata, default=json_safe) # ← JSON string
|
|
441
|
+
logger.info(f"Overflow reference stored for {k} → {metadata['_blob_key']}")
|
|
442
|
+
else:
|
|
443
|
+
reference_entity[k] = v
|
|
468
444
|
|
|
469
|
-
|
|
470
|
-
|
|
471
|
-
# ---------------------------------------------------
|
|
472
|
-
self._table_client.upsert_entity(entity)
|
|
445
|
+
self._table_client = self._get_table_client(model)
|
|
446
|
+
self._table_client.upsert_entity(reference_entity)
|
|
473
447
|
|
|
474
448
|
restored = self._unpack_entity(entity)
|
|
475
449
|
restored["id"] = safe_rk
|
|
@@ -535,7 +509,7 @@ class AzureTableStorageAdapter(NoSQLKVAdapter):
|
|
|
535
509
|
self._table_client = self._get_table_client(model)
|
|
536
510
|
# always enforce model filter
|
|
537
511
|
eff_filters = dict(filters or {})
|
|
538
|
-
eff_filters[_MODEL_FIELD] = model.__qualname__
|
|
512
|
+
# eff_filters[_MODEL_FIELD] = model.__qualname__
|
|
539
513
|
|
|
540
514
|
parts: List[str] = []
|
|
541
515
|
for orig_k, orig_v in eff_filters.items():
|
{altcodepro_polydb_python-2.3.6 → altcodepro_polydb_python-2.3.7}/src/polydb/base/NoSQLKVAdapter.py
RENAMED
|
@@ -36,8 +36,8 @@ class NoSQLKVAdapter:
|
|
|
36
36
|
def _get_pk_rk(self, model: type, data: JsonDict) -> Tuple[str, str]:
|
|
37
37
|
"""Extract PK/RK from model metadata"""
|
|
38
38
|
meta = getattr(model, "__polydb__", {})
|
|
39
|
-
pk_field = meta.get("pk_field") or
|
|
40
|
-
rk_field = meta.get("rk_field") or
|
|
39
|
+
pk_field = meta.get("pk_field") or meta.get("partition_key", "tenant_id")
|
|
40
|
+
rk_field = meta.get("rk_field") or meta.get("sort_key", "id")
|
|
41
41
|
|
|
42
42
|
if self.partition_config:
|
|
43
43
|
try:
|
|
@@ -217,8 +217,7 @@ class NoSQLKVAdapter:
|
|
|
217
217
|
# Protocol implementation
|
|
218
218
|
def put(self, model: type, data: JsonDict) -> JsonDict:
|
|
219
219
|
pk, rk = self._get_pk_rk(model, data)
|
|
220
|
-
|
|
221
|
-
return self._put_raw(model, pk, rk, store_data)
|
|
220
|
+
return self._put_raw(model, pk, rk, data)
|
|
222
221
|
|
|
223
222
|
def query(
|
|
224
223
|
self,
|
|
@@ -257,7 +256,7 @@ class NoSQLKVAdapter:
|
|
|
257
256
|
if isinstance(entity_id, dict):
|
|
258
257
|
pk = entity_id.get("partition_key") or entity_id.get("pk")
|
|
259
258
|
rk = entity_id.get("row_key") or entity_id.get("rk") or entity_id.get("id")
|
|
260
|
-
|
|
259
|
+
|
|
261
260
|
else:
|
|
262
261
|
pk, rk = self._get_pk_rk(model, {"id": entity_id})
|
|
263
262
|
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{altcodepro_polydb_python-2.3.6 → altcodepro_polydb_python-2.3.7}/src/polydb/adapters/EFSAdapter.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{altcodepro_polydb_python-2.3.6 → altcodepro_polydb_python-2.3.7}/src/polydb/adapters/S3Adapter.py
RENAMED
|
File without changes
|
|
File without changes
|
{altcodepro_polydb_python-2.3.6 → altcodepro_polydb_python-2.3.7}/src/polydb/adapters/SQSAdapter.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{altcodepro_polydb_python-2.3.6 → altcodepro_polydb_python-2.3.7}/src/polydb/adapters/__init__.py
RENAMED
|
File without changes
|
{altcodepro_polydb_python-2.3.6 → altcodepro_polydb_python-2.3.7}/src/polydb/advanced_query.py
RENAMED
|
File without changes
|
{altcodepro_polydb_python-2.3.6 → altcodepro_polydb_python-2.3.7}/src/polydb/audit/AuditStorage.py
RENAMED
|
File without changes
|
{altcodepro_polydb_python-2.3.6 → altcodepro_polydb_python-2.3.7}/src/polydb/audit/__init__.py
RENAMED
|
File without changes
|
{altcodepro_polydb_python-2.3.6 → altcodepro_polydb_python-2.3.7}/src/polydb/audit/context.py
RENAMED
|
File without changes
|
{altcodepro_polydb_python-2.3.6 → altcodepro_polydb_python-2.3.7}/src/polydb/audit/manager.py
RENAMED
|
File without changes
|
{altcodepro_polydb_python-2.3.6 → altcodepro_polydb_python-2.3.7}/src/polydb/audit/models.py
RENAMED
|
File without changes
|
|
File without changes
|
{altcodepro_polydb_python-2.3.6 → altcodepro_polydb_python-2.3.7}/src/polydb/base/QueueAdapter.py
RENAMED
|
File without changes
|
|
File without changes
|
{altcodepro_polydb_python-2.3.6 → altcodepro_polydb_python-2.3.7}/src/polydb/base/__init__.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
{altcodepro_polydb_python-2.3.6 → altcodepro_polydb_python-2.3.7}/src/polydb/cloudDatabaseFactory.py
RENAMED
|
File without changes
|
{altcodepro_polydb_python-2.3.6 → altcodepro_polydb_python-2.3.7}/src/polydb/databaseFactory.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{altcodepro_polydb_python-2.3.6 → altcodepro_polydb_python-2.3.7}/src/polydb/multitenancy.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{altcodepro_polydb_python-2.3.6 → altcodepro_polydb_python-2.3.7}/tests/test_cloud_factory.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
{altcodepro_polydb_python-2.3.6 → altcodepro_polydb_python-2.3.7}/tests/test_multi_engine.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|