altcodepro-polydb-python 2.3.24__py3-none-any.whl → 2.3.25__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.
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: altcodepro-polydb-python
3
- Version: 2.3.24
3
+ Version: 2.3.25
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
@@ -1,6 +1,6 @@
1
- altcodepro_polydb_python-2.3.24.dist-info/licenses/LICENSE,sha256=9X8GLocsBwy-5aR5JGOt2SAMDDPs9Qv-YnqmHBHOXrw,1067
1
+ altcodepro_polydb_python-2.3.25.dist-info/licenses/LICENSE,sha256=9X8GLocsBwy-5aR5JGOt2SAMDDPs9Qv-YnqmHBHOXrw,1067
2
2
  polydb/PolyDB.py,sha256=MG7-nV59zDvrUQwXNEgV4eetHCeW9TYY9DQqtxu_r7k,23543
3
- polydb/__init__.py,sha256=zx6yhNfaMDdshdDdcj4F8Vp9phCBA71mRFVi68IUELM,1459
3
+ polydb/__init__.py,sha256=d9KSz888A336904TPEjWPYBtyJLPB0lTdcaOnYp8byY,1535
4
4
  polydb/advanced_query.py,sha256=cxMB-EB-qT3bWXJlhmjnMCUtrzogORWyoEfS50Dy7go,4280
5
5
  polydb/batch.py,sha256=_DjWZa1ZXYSk6MLKqFe0eT7SYVRZtYNqZb9bI8Y2sao,4566
6
6
  polydb/cache.py,sha256=JBXF1XEK-fY80ar8SDE893Z1Z116YtXAEG0PaJ0Nkcw,7658
@@ -9,7 +9,7 @@ polydb/databaseFactory.py,sha256=uBzX7K-k_aFHLQyFemy3XIe3lsOjAvjRFfaC6phITlA,414
9
9
  polydb/decorators.py,sha256=L_WP2uXP_k8Ac49SUm-mthbM4jWI-XYfHXEyKzumOww,43062
10
10
  polydb/errors.py,sha256=jF_55fbfg6b6mBc116dzU_uBG9qiIKbr5jvmDuJx-Jw,1573
11
11
  polydb/json_safe.py,sha256=R5PrqAGirqjYKPyy-8KH-lSXjLH0FPr2TSGozy4eheU,149
12
- polydb/models.py,sha256=GBdyGNzLu7skKNMp2cZySsM_peEHB3QhhbsnKAS15D8,8942
12
+ polydb/models.py,sha256=pkGpYnEEJmXdoWVpWS2K3CnuO9JZ_91DKp1bpVNQCns,10259
13
13
  polydb/monitoring.py,sha256=UMm3ybyRJjAQi-prXXMLl9zuHhnhMnYBzMD3XWK66y8,9571
14
14
  polydb/multitenancy.py,sha256=9kyY98RpKg8xDy9ejB_MyV_YzF7eZd4uxashw5S8vlg,6408
15
15
  polydb/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
@@ -24,7 +24,7 @@ polydb/validation.py,sha256=a1o1d02k3c6PWQwkBbw_0nEmIgrdB5RR8OcpNQMn4cA,4810
24
24
  polydb/adapters/AzureBlobStorageAdapter.py,sha256=4vD55Z8DBTzBK66jIJbo5bNMY-AQ61MlP0-P2Fv_JgQ,7083
25
25
  polydb/adapters/AzureFileStorageAdapter.py,sha256=VZNprqlBXCuWUgtqClNT-NrQmRf-XFYEiRA2BLbf-Sc,7046
26
26
  polydb/adapters/AzureQueueAdapter.py,sha256=5PrKAX4OQxUD5nReZKrInF_mjQVdFcj2aYd0Xp-HjjQ,5254
27
- polydb/adapters/AzureTableStorageAdapter.py,sha256=Gu7Xmi1Q79sUHNAEj6YMohF-Oy1Ar35d7OT1qUHKGOE,26198
27
+ polydb/adapters/AzureTableStorageAdapter.py,sha256=CTi8qCVQDujqBGIfLJu2fgA2sNkDt07zrNIdyuQIcl4,27053
28
28
  polydb/adapters/BlockchainBlobAdapter.py,sha256=D01Yua9mkKfaQrxKYApblIyI6DSP0dtNAh4Tav51HJ4,3299
29
29
  polydb/adapters/BlockchainFileAdapter.py,sha256=G749xOVpG20HuKS8zCgi6PMjoJNu-YXK7zitygjLdzM,8335
30
30
  polydb/adapters/BlockchainKVAdapter.py,sha256=UFYHyTgvdW-sZUBqyHEG3Cdx6wSTiF2QowEVWL3XPTg,4564
@@ -60,7 +60,7 @@ polydb/observability/logging.py,sha256=gv1SshNjaSkmR98Uv7Qbwq3gkeQUzVCA4ichqHKL6
60
60
  polydb/services/__init__.py,sha256=nMolMXzmhejRSm7f42kU9fCHF0GIpqpejN2kywuBsUQ,241
61
61
  polydb/services/compliance_service.py,sha256=-0ncX7PrXy4-NuyWXIv65cLUsqz0jXzb3LtsD8rlrXE,4983
62
62
  polydb/services/security_service.py,sha256=q7GzK6sbMnBBsc4fuL4oXTd-ui2b-MYQyrWTBvdVNSk,5062
63
- altcodepro_polydb_python-2.3.24.dist-info/METADATA,sha256=oChx1wdfnxF14DH2I2WvFTJWrceIEvoJ-88gzaCXlvY,12359
64
- altcodepro_polydb_python-2.3.24.dist-info/WHEEL,sha256=aeYiig01lYGDzBgS8HxWXOg3uV61G9ijOsup-k9o1sk,91
65
- altcodepro_polydb_python-2.3.24.dist-info/top_level.txt,sha256=WgLFWJoYjUhwvyPxJFl6jYLrVFuBJDX3OABf4ocwk_E,7
66
- altcodepro_polydb_python-2.3.24.dist-info/RECORD,,
63
+ altcodepro_polydb_python-2.3.25.dist-info/METADATA,sha256=jKo3HkAeo__dmf5vAvRukWvNcqqe1tIscypWPzcju3M,12359
64
+ altcodepro_polydb_python-2.3.25.dist-info/WHEEL,sha256=K260EYznzXsJYBQGqmI8VTxEdiZYNvDZwW9cBh9-_MA,91
65
+ altcodepro_polydb_python-2.3.25.dist-info/top_level.txt,sha256=WgLFWJoYjUhwvyPxJFl6jYLrVFuBJDX3OABf4ocwk_E,7
66
+ altcodepro_polydb_python-2.3.25.dist-info/RECORD,,
@@ -1,5 +1,5 @@
1
1
  Wheel-Version: 1.0
2
- Generator: setuptools (82.0.1)
2
+ Generator: setuptools (83.0.0)
3
3
  Root-Is-Purelib: true
4
4
  Tag: py3-none-any
5
5
 
polydb/__init__.py CHANGED
@@ -8,7 +8,7 @@ __version__ = "2.2.3"
8
8
 
9
9
  from .cloudDatabaseFactory import CloudDatabaseFactory
10
10
  from .databaseFactory import DatabaseFactory
11
- from .models import CloudProvider, PartitionConfig
11
+ from .models import CloudProvider, PartitionConfig, MongoConfig, CosmosMongoConfig
12
12
  from .query import QueryBuilder, Operator
13
13
  from .audit.context import AuditContext
14
14
  from .cache import RedisCacheEngine as CacheEngine
@@ -36,6 +36,8 @@ __all__ = [
36
36
  # Models & Config
37
37
  "CloudProvider",
38
38
  "PartitionConfig",
39
+ "MongoConfig",
40
+ "CosmosMongoConfig",
39
41
  # Query
40
42
  "QueryBuilder",
41
43
  "Operator",
@@ -567,7 +567,18 @@ class AzureTableStorageAdapter(NoSQLKVAdapter):
567
567
  sval = str(ev).replace("'", "''")
568
568
  parts.append(f"{sk} eq '{sval}'")
569
569
 
570
- query_filter = " and ".join(parts) if parts else None
570
+ # Empty-filter contract: if the caller passed filter keys but every
571
+ # condition dropped out (e.g. all values None/unresolvable), the query
572
+ # must match NOTHING — return [] (→ None for a single-object read).
573
+ # Returning all entities here (query_filter=None) is how an unmatched
574
+ # read_one accidentally returned a stray context row. Only a genuinely
575
+ # empty filter dict means "list all".
576
+ if not parts:
577
+ if eff_filters:
578
+ return []
579
+ query_filter = None
580
+ else:
581
+ query_filter = " and ".join(parts)
571
582
 
572
583
  entities = table_client.query_entities(query_filter=query_filter)
573
584
 
@@ -670,6 +681,10 @@ class AzureTableStorageAdapter(NoSQLKVAdapter):
670
681
  else:
671
682
  sval = str(ev).replace("'", "''")
672
683
  parts.append(f"{sk} eq '{sval}'")
684
+ # Same empty-filter contract as _query_raw: filter keys that all resolved
685
+ # to no condition must match NOTHING, not list the whole table.
686
+ if not parts and eff_filters:
687
+ return PageResult(items=[], next_cursor=None, has_more=False)
673
688
  query_filter = " and ".join(parts) if parts else None
674
689
 
675
690
  azure_ct = None
polydb/models.py CHANGED
@@ -323,3 +323,38 @@ class MongoConfig(StorageConfig):
323
323
  super().__init__(CloudProvider.MONGODB, name)
324
324
  self.mongo_uri = mongo_uri
325
325
  self.db_name = db_name
326
+
327
+
328
+ class CosmosMongoConfig(MongoConfig):
329
+ """Azure Cosmos DB via the **MongoDB API**.
330
+
331
+ Cosmos-for-Mongo speaks the MongoDB wire protocol, so it needs no adapter of
332
+ its own — it rides the existing ``MongoDBAdapter`` (and thus the whole polydb
333
+ stack) unchanged. This gives the best of both: Azure-native, serverless /
334
+ autoscale, managed billing + monitoring **and** portability — the same app
335
+ runs on MongoDB Atlas by swapping the connection string.
336
+
337
+ Pass a full ``connection_string`` (recommended — works for both RU and vCore),
338
+ or ``account`` + ``key`` to build the standard Cosmos-for-Mongo (RU) URI.
339
+ """
340
+
341
+ def __init__(
342
+ self,
343
+ name: str = "cosmos",
344
+ *,
345
+ connection_string: str = "",
346
+ account: str = "",
347
+ key: str = "",
348
+ db_name: str = "",
349
+ port: int = 10255,
350
+ ):
351
+ uri = connection_string
352
+ if not uri and account and key:
353
+ uri = (
354
+ f"mongodb://{account}:{key}@{account}.mongo.cosmos.azure.com:{port}/"
355
+ f"?ssl=true&replicaSet=globaldb&retrywrites=false"
356
+ f"&maxIdleTimeMS=120000&appName=@{account}@"
357
+ )
358
+ super().__init__(name=name, mongo_uri=uri, db_name=db_name)
359
+ self.is_cosmos = True
360
+ self.account = account