macss-modular-api-postgres 0.5.0__py3-none-any.whl → 0.6.0__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.
- {macss_modular_api_postgres-0.5.0.dist-info → macss_modular_api_postgres-0.6.0.dist-info}/METADATA +5 -3
- macss_modular_api_postgres-0.6.0.dist-info/RECORD +6 -0
- modular_api_postgres/__init__.py +6 -0
- modular_api_postgres/db_client.py +42 -0
- macss_modular_api_postgres-0.5.0.dist-info/RECORD +0 -6
- {macss_modular_api_postgres-0.5.0.dist-info → macss_modular_api_postgres-0.6.0.dist-info}/WHEEL +0 -0
- {macss_modular_api_postgres-0.5.0.dist-info → macss_modular_api_postgres-0.6.0.dist-info}/top_level.txt +0 -0
{macss_modular_api_postgres-0.5.0.dist-info → macss_modular_api_postgres-0.6.0.dist-info}/METADATA
RENAMED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: macss-modular-api-postgres
|
|
3
|
-
Version: 0.
|
|
3
|
+
Version: 0.6.0
|
|
4
4
|
Summary: Official MACSS Postgres integration package for Python.
|
|
5
5
|
Author: ccisne.dev
|
|
6
6
|
License-Expression: MIT
|
|
@@ -56,10 +56,12 @@ else:
|
|
|
56
56
|
|
|
57
57
|
See [example/example.py](example/example.py) for a complete in-memory wiring sample.
|
|
58
58
|
|
|
59
|
-
##
|
|
59
|
+
## What this package provides
|
|
60
60
|
|
|
61
61
|
- normalized Postgres connection defaults and redacted summaries
|
|
62
62
|
- engine-agnostic `DbClient`, `DbRepository`, and transaction contracts
|
|
63
63
|
- explicit lease ownership semantics for package-owned and application-owned sessions
|
|
64
64
|
- health contributor and GraphQL support bundle for higher-level integrations
|
|
65
|
-
-
|
|
65
|
+
- the application supplies the driver binding (adapter) for its chosen engine and driver
|
|
66
|
+
|
|
67
|
+
This package is **contracts-only by design** and will never ship a driver binding; you choose your engine and driver and provide the adapter. See [ADR-0004](../../../docs/adr/0004-contracts-only-database-packages.md).
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
modular_api_postgres/__init__.py,sha256=c9XangXXy8b_QVIM2f1S4_lZ9ZIN6iMD1rCkmiRjXIs,1229
|
|
2
|
+
modular_api_postgres/db_client.py,sha256=LWnucyg950r1b2qYaOYNC6cqsi9ehJUZewGTNSt1EbU,14269
|
|
3
|
+
macss_modular_api_postgres-0.6.0.dist-info/METADATA,sha256=Kcww5RFyjH3b0KQDwmzRh3B0klY4VibP89abFESPc0g,2448
|
|
4
|
+
macss_modular_api_postgres-0.6.0.dist-info/WHEEL,sha256=aeYiig01lYGDzBgS8HxWXOg3uV61G9ijOsup-k9o1sk,91
|
|
5
|
+
macss_modular_api_postgres-0.6.0.dist-info/top_level.txt,sha256=256SRpi7HI1fM37vDEnZVT6An9ivmo9YcA7TJN1Dmuk,21
|
|
6
|
+
macss_modular_api_postgres-0.6.0.dist-info/RECORD,,
|
modular_api_postgres/__init__.py
CHANGED
|
@@ -14,6 +14,9 @@ from .db_client import (
|
|
|
14
14
|
DbHealthContributor,
|
|
15
15
|
DbHealthReport,
|
|
16
16
|
DbHealthStatus,
|
|
17
|
+
DbParameter,
|
|
18
|
+
DbParameterDirection,
|
|
19
|
+
DbProcedureOutcome,
|
|
17
20
|
DbProviderDescription,
|
|
18
21
|
DbRepository,
|
|
19
22
|
DbRepositoryContext,
|
|
@@ -40,6 +43,9 @@ __all__ = [
|
|
|
40
43
|
"DbHealthContributor",
|
|
41
44
|
"DbHealthReport",
|
|
42
45
|
"DbHealthStatus",
|
|
46
|
+
"DbParameter",
|
|
47
|
+
"DbParameterDirection",
|
|
48
|
+
"DbProcedureOutcome",
|
|
43
49
|
"DbProviderDescription",
|
|
44
50
|
"DbRepository",
|
|
45
51
|
"DbRepositoryContext",
|
|
@@ -17,6 +17,13 @@ class DbCommandKind(str, Enum):
|
|
|
17
17
|
EXECUTE = "execute"
|
|
18
18
|
BATCH = "batch"
|
|
19
19
|
SCALAR = "scalar"
|
|
20
|
+
PROCEDURE = "procedure"
|
|
21
|
+
|
|
22
|
+
|
|
23
|
+
class DbParameterDirection(str, Enum):
|
|
24
|
+
INPUT = "input"
|
|
25
|
+
OUTPUT = "output"
|
|
26
|
+
INPUT_OUTPUT = "inputOutput"
|
|
20
27
|
|
|
21
28
|
|
|
22
29
|
class DbFailureKind(str, Enum):
|
|
@@ -81,6 +88,39 @@ class DbConnectionSettings:
|
|
|
81
88
|
)
|
|
82
89
|
|
|
83
90
|
|
|
91
|
+
@dataclass(frozen=True, slots=True)
|
|
92
|
+
class DbParameter:
|
|
93
|
+
name: str
|
|
94
|
+
value: object | None = None
|
|
95
|
+
direction: DbParameterDirection = DbParameterDirection.INPUT
|
|
96
|
+
type_hint: str | None = None
|
|
97
|
+
|
|
98
|
+
@classmethod
|
|
99
|
+
def input(cls, name: str, value: object | None, type_hint: str | None = None) -> DbParameter:
|
|
100
|
+
return cls(name=name, value=value, direction=DbParameterDirection.INPUT, type_hint=type_hint)
|
|
101
|
+
|
|
102
|
+
@classmethod
|
|
103
|
+
def output(cls, name: str, type_hint: str | None = None) -> DbParameter:
|
|
104
|
+
return cls(name=name, direction=DbParameterDirection.OUTPUT, type_hint=type_hint)
|
|
105
|
+
|
|
106
|
+
@classmethod
|
|
107
|
+
def input_output(
|
|
108
|
+
cls, name: str, value: object | None, type_hint: str | None = None
|
|
109
|
+
) -> DbParameter:
|
|
110
|
+
return cls(
|
|
111
|
+
name=name,
|
|
112
|
+
value=value,
|
|
113
|
+
direction=DbParameterDirection.INPUT_OUTPUT,
|
|
114
|
+
type_hint=type_hint,
|
|
115
|
+
)
|
|
116
|
+
|
|
117
|
+
|
|
118
|
+
@dataclass(frozen=True, slots=True)
|
|
119
|
+
class DbProcedureOutcome:
|
|
120
|
+
return_value: object | None = None
|
|
121
|
+
output_parameters: Mapping[str, object] | None = None
|
|
122
|
+
|
|
123
|
+
|
|
84
124
|
@dataclass(frozen=True, slots=True)
|
|
85
125
|
class DbCommand:
|
|
86
126
|
kind: DbCommandKind
|
|
@@ -101,12 +141,14 @@ class DbExecutionMetadata:
|
|
|
101
141
|
class DbRowSet:
|
|
102
142
|
rows: list[Mapping[str, object]]
|
|
103
143
|
metadata: DbExecutionMetadata
|
|
144
|
+
procedure: DbProcedureOutcome | None = None
|
|
104
145
|
|
|
105
146
|
|
|
106
147
|
@dataclass(frozen=True, slots=True)
|
|
107
148
|
class DbExecutionSummary:
|
|
108
149
|
affected_count: int
|
|
109
150
|
metadata: DbExecutionMetadata
|
|
151
|
+
procedure: DbProcedureOutcome | None = None
|
|
110
152
|
|
|
111
153
|
|
|
112
154
|
@dataclass(frozen=True, slots=True)
|
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
modular_api_postgres/__init__.py,sha256=URrLgEvTQBn48LkyY7aJsz5vzwC38lEo_AMgF1JY0a4,1089
|
|
2
|
-
modular_api_postgres/db_client.py,sha256=ixskWFwjikbIV_OsHCncYTjbKZTR4ZQdtbLD1ErmN0A,12959
|
|
3
|
-
macss_modular_api_postgres-0.5.0.dist-info/METADATA,sha256=MNLXC_3ETdjNIbQCawjng1QypOi1OqcL-EL-IwJIiGU,2196
|
|
4
|
-
macss_modular_api_postgres-0.5.0.dist-info/WHEEL,sha256=aeYiig01lYGDzBgS8HxWXOg3uV61G9ijOsup-k9o1sk,91
|
|
5
|
-
macss_modular_api_postgres-0.5.0.dist-info/top_level.txt,sha256=256SRpi7HI1fM37vDEnZVT6An9ivmo9YcA7TJN1Dmuk,21
|
|
6
|
-
macss_modular_api_postgres-0.5.0.dist-info/RECORD,,
|
{macss_modular_api_postgres-0.5.0.dist-info → macss_modular_api_postgres-0.6.0.dist-info}/WHEEL
RENAMED
|
File without changes
|
|
File without changes
|