altcodepro-polydb-python 2.3.1__py3-none-any.whl → 2.3.2__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.
- {altcodepro_polydb_python-2.3.1.dist-info → altcodepro_polydb_python-2.3.2.dist-info}/METADATA +1 -1
- {altcodepro_polydb_python-2.3.1.dist-info → altcodepro_polydb_python-2.3.2.dist-info}/RECORD +6 -6
- polydb/adapters/AzureTableStorageAdapter.py +27 -9
- {altcodepro_polydb_python-2.3.1.dist-info → altcodepro_polydb_python-2.3.2.dist-info}/WHEEL +0 -0
- {altcodepro_polydb_python-2.3.1.dist-info → altcodepro_polydb_python-2.3.2.dist-info}/licenses/LICENSE +0 -0
- {altcodepro_polydb_python-2.3.1.dist-info → altcodepro_polydb_python-2.3.2.dist-info}/top_level.txt +0 -0
{altcodepro_polydb_python-2.3.1.dist-info → altcodepro_polydb_python-2.3.2.dist-info}/METADATA
RENAMED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: altcodepro-polydb-python
|
|
3
|
-
Version: 2.3.
|
|
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
|
{altcodepro_polydb_python-2.3.1.dist-info → altcodepro_polydb_python-2.3.2.dist-info}/RECORD
RENAMED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
altcodepro_polydb_python-2.3.
|
|
1
|
+
altcodepro_polydb_python-2.3.2.dist-info/licenses/LICENSE,sha256=9X8GLocsBwy-5aR5JGOt2SAMDDPs9Qv-YnqmHBHOXrw,1067
|
|
2
2
|
polydb/PolyDB.py,sha256=p9eDdvBGosE4fNSSAbtq3tHObdKZ-C2V2Q_ia39Ackk,23397
|
|
3
3
|
polydb/__init__.py,sha256=UhUzfSvmMgKbV2tSME1ooIyfshIBi7_WyU4xl1tWWiA,1454
|
|
4
4
|
polydb/advanced_query.py,sha256=cxMB-EB-qT3bWXJlhmjnMCUtrzogORWyoEfS50Dy7go,4280
|
|
@@ -24,7 +24,7 @@ polydb/validation.py,sha256=a1o1d02k3c6PWQwkBbw_0nEmIgrdB5RR8OcpNQMn4cA,4810
|
|
|
24
24
|
polydb/adapters/AzureBlobStorageAdapter.py,sha256=iNscCIeoWy4YJo3IbI7gNam-NUT7t45ayrlPnYfqlCQ,6409
|
|
25
25
|
polydb/adapters/AzureFileStorageAdapter.py,sha256=OuZY5P-FTQ36954obJN65oSMqmW3d-7QBmXxVGX0lds,6086
|
|
26
26
|
polydb/adapters/AzureQueueAdapter.py,sha256=5tslwI0DgvMeb20w57aVSSSKiuCJEKrYjN0kGuFcdUI,5276
|
|
27
|
-
polydb/adapters/AzureTableStorageAdapter.py,sha256=
|
|
27
|
+
polydb/adapters/AzureTableStorageAdapter.py,sha256=Vm-D769VLeaWtGYluAWt1gXehckn7n9V8XQmu-_avdU,19296
|
|
28
28
|
polydb/adapters/BlockchainBlobAdapter.py,sha256=BXSDT6rDGGE04qM2-dVNAeWk-VcF82JGHAdUJeYHCbI,3320
|
|
29
29
|
polydb/adapters/BlockchainKVAdapter.py,sha256=5Egic8QyulgYcy9O12iWKq2EDyVEvnXp_ereYgIvbHk,4546
|
|
30
30
|
polydb/adapters/BlockchainQueueAdapter.py,sha256=K01klT8Eu8c-y1G9Sg2r0PIjay_at9x27kCTTEHPkNY,4179
|
|
@@ -52,7 +52,7 @@ polydb/base/ObjectStorageAdapter.py,sha256=mNdJnhoB3VqSCQvmcoel5PohrVQw7Nrajdd5s
|
|
|
52
52
|
polydb/base/QueueAdapter.py,sha256=jFgyG-SUK4nhRNxm2NbzUbwnA9b_5iAC-ikLSUpXRwk,799
|
|
53
53
|
polydb/base/SharedFilesAdapter.py,sha256=hvmdNNhNxpN46Ob9RLAi8l46GB6JolYyZWnAMuaJ86g,708
|
|
54
54
|
polydb/base/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
55
|
-
altcodepro_polydb_python-2.3.
|
|
56
|
-
altcodepro_polydb_python-2.3.
|
|
57
|
-
altcodepro_polydb_python-2.3.
|
|
58
|
-
altcodepro_polydb_python-2.3.
|
|
55
|
+
altcodepro_polydb_python-2.3.2.dist-info/METADATA,sha256=9FRHXZeQilTQpyTuZQNTikb563gty04s8VUGc0cQJAU,11910
|
|
56
|
+
altcodepro_polydb_python-2.3.2.dist-info/WHEEL,sha256=aeYiig01lYGDzBgS8HxWXOg3uV61G9ijOsup-k9o1sk,91
|
|
57
|
+
altcodepro_polydb_python-2.3.2.dist-info/top_level.txt,sha256=WgLFWJoYjUhwvyPxJFl6jYLrVFuBJDX3OABf4ocwk_E,7
|
|
58
|
+
altcodepro_polydb_python-2.3.2.dist-info/RECORD,,
|
|
@@ -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@@:"
|
|
@@ -323,14 +325,28 @@ class AzureTableStorageAdapter(NoSQLKVAdapter):
|
|
|
323
325
|
|
|
324
326
|
entity = self._pack_entity(model, safe_pk, safe_rk, data)
|
|
325
327
|
|
|
326
|
-
|
|
327
|
-
|
|
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
|
-
|
|
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
|
-
#
|
|
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
|
|
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
|
|
|
File without changes
|
|
File without changes
|
{altcodepro_polydb_python-2.3.1.dist-info → altcodepro_polydb_python-2.3.2.dist-info}/top_level.txt
RENAMED
|
File without changes
|