dominus-sdk-python-dev 2.1.6__py3-none-any.whl → 2.1.7__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.
- dominus/__init__.py +47 -47
- dominus/config/__init__.py +24 -24
- dominus/config/endpoints.py +39 -39
- dominus/errors.py +201 -201
- dominus/helpers/__init__.py +2 -2
- dominus/helpers/auth.py +23 -23
- dominus/helpers/cache.py +192 -192
- dominus/helpers/core.py +657 -657
- dominus/helpers/crypto.py +118 -118
- dominus/namespaces/__init__.py +26 -26
- dominus/namespaces/_deprecated_crossover.py +10 -10
- dominus/namespaces/_deprecated_sql.py +1341 -1341
- dominus/namespaces/auth.py +1056 -1056
- dominus/namespaces/courier.py +251 -251
- dominus/namespaces/db.py +267 -267
- dominus/namespaces/ddl.py +590 -590
- dominus/namespaces/files.py +299 -299
- dominus/namespaces/health.py +59 -59
- dominus/namespaces/logs.py +367 -367
- dominus/namespaces/open.py +72 -72
- dominus/namespaces/portal.py +504 -504
- dominus/namespaces/redis.py +357 -357
- dominus/namespaces/secrets.py +126 -126
- dominus/services/__init__.py +2 -2
- dominus/services/_deprecated_architect.py +323 -323
- dominus/services/_deprecated_sovereign.py +93 -93
- dominus/start.py +1034 -1034
- {dominus_sdk_python_dev-2.1.6.dist-info → dominus_sdk_python_dev-2.1.7.dist-info}/METADATA +381 -381
- dominus_sdk_python_dev-2.1.7.dist-info/RECORD +31 -0
- dominus_sdk_python_dev-2.1.6.dist-info/RECORD +0 -31
- {dominus_sdk_python_dev-2.1.6.dist-info → dominus_sdk_python_dev-2.1.7.dist-info}/WHEEL +0 -0
- {dominus_sdk_python_dev-2.1.6.dist-info → dominus_sdk_python_dev-2.1.7.dist-info}/top_level.txt +0 -0
dominus/namespaces/open.py
CHANGED
|
@@ -1,72 +1,72 @@
|
|
|
1
|
-
"""
|
|
2
|
-
Open Namespace - Direct database access operations.
|
|
3
|
-
|
|
4
|
-
Provides DSN retrieval and raw SQL execution for advanced use cases.
|
|
5
|
-
"""
|
|
6
|
-
from typing import Any, Dict, Optional, TYPE_CHECKING
|
|
7
|
-
|
|
8
|
-
if TYPE_CHECKING:
|
|
9
|
-
from ..start import Dominus
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
class OpenNamespace:
|
|
13
|
-
"""
|
|
14
|
-
Open database access namespace.
|
|
15
|
-
|
|
16
|
-
Provides direct database connection info and raw SQL execution.
|
|
17
|
-
Use with caution - bypasses most safety checks.
|
|
18
|
-
|
|
19
|
-
Usage:
|
|
20
|
-
# Get connection DSN
|
|
21
|
-
dsn = await dominus.open.dsn()
|
|
22
|
-
|
|
23
|
-
# Execute raw SQL
|
|
24
|
-
result = await dominus.open.execute("SELECT * FROM public.users WHERE id = $1", {"1": user_id})
|
|
25
|
-
"""
|
|
26
|
-
|
|
27
|
-
def __init__(self, client: "Dominus"):
|
|
28
|
-
self._client = client
|
|
29
|
-
|
|
30
|
-
async def dsn(self) -> str:
|
|
31
|
-
"""
|
|
32
|
-
Get the PostgreSQL connection DSN.
|
|
33
|
-
|
|
34
|
-
Returns the complete PostgreSQL connection URI that can be
|
|
35
|
-
used directly by clients to connect to the database.
|
|
36
|
-
|
|
37
|
-
Returns:
|
|
38
|
-
PostgreSQL connection URI string
|
|
39
|
-
"""
|
|
40
|
-
result = await self._client._request(
|
|
41
|
-
endpoint="/api/scribe/open/dsn",
|
|
42
|
-
method="GET"
|
|
43
|
-
)
|
|
44
|
-
if isinstance(result, dict):
|
|
45
|
-
return result.get("dsn", result.get("connection_string", ""))
|
|
46
|
-
return result
|
|
47
|
-
|
|
48
|
-
async def execute(
|
|
49
|
-
self,
|
|
50
|
-
sql: str,
|
|
51
|
-
params: Optional[Dict[str, Any]] = None
|
|
52
|
-
) -> Dict[str, Any]:
|
|
53
|
-
"""
|
|
54
|
-
Execute raw SQL query.
|
|
55
|
-
|
|
56
|
-
Use with caution - this bypasses most safety checks.
|
|
57
|
-
|
|
58
|
-
Args:
|
|
59
|
-
sql: SQL query string
|
|
60
|
-
params: Optional parameter dictionary
|
|
61
|
-
|
|
62
|
-
Returns:
|
|
63
|
-
Query result
|
|
64
|
-
"""
|
|
65
|
-
body = {"sql": sql}
|
|
66
|
-
if params:
|
|
67
|
-
body["params"] = params
|
|
68
|
-
|
|
69
|
-
return await self._client._request(
|
|
70
|
-
endpoint="/api/scribe/open/execute",
|
|
71
|
-
body=body
|
|
72
|
-
)
|
|
1
|
+
"""
|
|
2
|
+
Open Namespace - Direct database access operations.
|
|
3
|
+
|
|
4
|
+
Provides DSN retrieval and raw SQL execution for advanced use cases.
|
|
5
|
+
"""
|
|
6
|
+
from typing import Any, Dict, Optional, TYPE_CHECKING
|
|
7
|
+
|
|
8
|
+
if TYPE_CHECKING:
|
|
9
|
+
from ..start import Dominus
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
class OpenNamespace:
|
|
13
|
+
"""
|
|
14
|
+
Open database access namespace.
|
|
15
|
+
|
|
16
|
+
Provides direct database connection info and raw SQL execution.
|
|
17
|
+
Use with caution - bypasses most safety checks.
|
|
18
|
+
|
|
19
|
+
Usage:
|
|
20
|
+
# Get connection DSN
|
|
21
|
+
dsn = await dominus.open.dsn()
|
|
22
|
+
|
|
23
|
+
# Execute raw SQL
|
|
24
|
+
result = await dominus.open.execute("SELECT * FROM public.users WHERE id = $1", {"1": user_id})
|
|
25
|
+
"""
|
|
26
|
+
|
|
27
|
+
def __init__(self, client: "Dominus"):
|
|
28
|
+
self._client = client
|
|
29
|
+
|
|
30
|
+
async def dsn(self) -> str:
|
|
31
|
+
"""
|
|
32
|
+
Get the PostgreSQL connection DSN.
|
|
33
|
+
|
|
34
|
+
Returns the complete PostgreSQL connection URI that can be
|
|
35
|
+
used directly by clients to connect to the database.
|
|
36
|
+
|
|
37
|
+
Returns:
|
|
38
|
+
PostgreSQL connection URI string
|
|
39
|
+
"""
|
|
40
|
+
result = await self._client._request(
|
|
41
|
+
endpoint="/api/scribe/open/dsn",
|
|
42
|
+
method="GET"
|
|
43
|
+
)
|
|
44
|
+
if isinstance(result, dict):
|
|
45
|
+
return result.get("dsn", result.get("connection_string", ""))
|
|
46
|
+
return result
|
|
47
|
+
|
|
48
|
+
async def execute(
|
|
49
|
+
self,
|
|
50
|
+
sql: str,
|
|
51
|
+
params: Optional[Dict[str, Any]] = None
|
|
52
|
+
) -> Dict[str, Any]:
|
|
53
|
+
"""
|
|
54
|
+
Execute raw SQL query.
|
|
55
|
+
|
|
56
|
+
Use with caution - this bypasses most safety checks.
|
|
57
|
+
|
|
58
|
+
Args:
|
|
59
|
+
sql: SQL query string
|
|
60
|
+
params: Optional parameter dictionary
|
|
61
|
+
|
|
62
|
+
Returns:
|
|
63
|
+
Query result
|
|
64
|
+
"""
|
|
65
|
+
body = {"sql": sql}
|
|
66
|
+
if params:
|
|
67
|
+
body["params"] = params
|
|
68
|
+
|
|
69
|
+
return await self._client._request(
|
|
70
|
+
endpoint="/api/scribe/open/execute",
|
|
71
|
+
body=body
|
|
72
|
+
)
|