Commit 48bc0f3
* docs(adr): add ADR-0062 shared-connection-settings-builder (#681)
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
* docs(adr): ADR-0062 → Service.Infra.Postgres.ConnectionConfig (maintainer decision)
* refactor(service): unify the three Postgres connection-settings builders (#681)
Implements ADR-0062: extract one shared Postgres connection-settings builder (Service.Infra.Postgres.ConnectionConfig) that all three pools route through, so keepalives and the observation handler apply uniformly. No public API change.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
* refactor(service): address CodeRabbit — explicit imports, port validation, inspectable ConnectionParams tests
- Imports (Fix 1): dedupe the double Hasql.Connection.Setting alias; bring
used hasql types in explicitly (Setting, Config, Word16) and keep module
functions qualified, per the qualified-import contract.
- Port validation (Fix 2): add shared validatePort (1..65535) in the single
shared path — resolveParams/toConnectionParams now return Result Text,
failing fast with `port must be in 1..65535, got N` instead of the silent
Word16 wrap. All three pools (EventStore, QueryObjectStore, FileUpload)
surface it in their own error type; FileUpload gains an InvalidPort variant.
- Inspectable tests (Fix 3): add ResolvedParams (Eq, no Show) capturing every
libpq field plus the four ADR-0037 keepalives as data; the spec now asserts
host/db/user/password/port AND all four keepalive entries exactly, and both
port boundaries / out-of-range inputs.
- Module visibility (Fix 4): kept Service.Infra.Postgres.ConnectionConfig in
exposed-modules (FALLBACK). The preferred move to other-modules + adding the
library `service` dir to the test suite caused mass local recompilation and
EndpointSchema type-identity ambiguity (package vs home module); explained
on the CodeRabbit thread. It remains internal infra with no stability promise.
- ADR (Fix 5): drop Show from the ConnectionParams example derivation to match
the implementation (password hygiene). Status stays Proposed.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
---------
Co-authored-by: NickSeagullBot <bot@nickseagull.dev>
Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
1 parent c7ffced commit 48bc0f3
10 files changed
Lines changed: 934 additions & 144 deletions
File tree
- core
- service/Service
- EventStore/Postgres
- FileUpload/FileStateStore
- Infra/Postgres
- QueryObjectStore
- test-service
- Service/Infra/Postgres
- test/Service/EventStore/Postgres
- docs/decisions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
243 | 243 | | |
244 | 244 | | |
245 | 245 | | |
| 246 | + | |
246 | 247 | | |
247 | 248 | | |
248 | 249 | | |
| |||
566 | 567 | | |
567 | 568 | | |
568 | 569 | | |
| 570 | + | |
569 | 571 | | |
570 | 572 | | |
571 | 573 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
16 | 16 | | |
17 | 17 | | |
18 | 18 | | |
19 | | - | |
20 | 19 | | |
21 | | - | |
22 | | - | |
23 | 20 | | |
24 | | - | |
25 | | - | |
26 | 21 | | |
27 | 22 | | |
28 | | - | |
29 | 23 | | |
30 | 24 | | |
31 | 25 | | |
32 | 26 | | |
| 27 | + | |
33 | 28 | | |
34 | 29 | | |
35 | 30 | | |
| |||
97 | 92 | | |
98 | 93 | | |
99 | 94 | | |
100 | | - | |
101 | | - | |
102 | | - | |
103 | | - | |
104 | | - | |
105 | | - | |
106 | | - | |
107 | | - | |
108 | | - | |
109 | | - | |
110 | | - | |
111 | | - | |
112 | | - | |
113 | | - | |
114 | | - | |
115 | | - | |
116 | | - | |
117 | | - | |
118 | | - | |
119 | | - | |
120 | | - | |
121 | | - | |
122 | | - | |
123 | | - | |
124 | | - | |
125 | | - | |
126 | | - | |
127 | | - | |
128 | | - | |
129 | | - | |
130 | | - | |
131 | | - | |
132 | | - | |
133 | | - | |
134 | | - | |
135 | | - | |
136 | | - | |
137 | | - | |
138 | | - | |
139 | | - | |
140 | | - | |
141 | | - | |
142 | | - | |
143 | | - | |
144 | | - | |
145 | | - | |
146 | | - | |
| 95 | + | |
| 96 | + | |
| 97 | + | |
| 98 | + | |
| 99 | + | |
| 100 | + | |
| 101 | + | |
| 102 | + | |
| 103 | + | |
| 104 | + | |
| 105 | + | |
| 106 | + | |
| 107 | + | |
| 108 | + | |
| 109 | + | |
| 110 | + | |
| 111 | + | |
| 112 | + | |
| 113 | + | |
| 114 | + | |
147 | 115 | | |
148 | 116 | | |
149 | 117 | | |
| |||
162 | 130 | | |
163 | 131 | | |
164 | 132 | | |
165 | | - | |
166 | | - | |
167 | | - | |
168 | | - | |
169 | | - | |
| 133 | + | |
| 134 | + | |
| 135 | + | |
| 136 | + | |
| 137 | + | |
| 138 | + | |
| 139 | + | |
| 140 | + | |
| 141 | + | |
170 | 142 | | |
171 | 143 | | |
172 | 144 | | |
173 | 145 | | |
174 | 146 | | |
175 | 147 | | |
176 | 148 | | |
177 | | - | |
| 149 | + | |
| 150 | + | |
178 | 151 | | |
179 | 152 | | |
180 | 153 | | |
| |||
185 | 158 | | |
186 | 159 | | |
187 | 160 | | |
188 | | - | |
189 | | - | |
| 161 | + | |
| 162 | + | |
| 163 | + | |
190 | 164 | | |
191 | 165 | | |
192 | 166 | | |
| |||
798 | 772 | | |
799 | 773 | | |
800 | 774 | | |
| 775 | + | |
| 776 | + | |
| 777 | + | |
801 | 778 | | |
802 | | - | |
| 779 | + | |
803 | 780 | | |
804 | 781 | | |
805 | 782 | | |
| |||
Lines changed: 16 additions & 46 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
53 | 53 | | |
54 | 54 | | |
55 | 55 | | |
56 | | - | |
57 | | - | |
58 | | - | |
59 | 56 | | |
60 | 57 | | |
61 | 58 | | |
62 | 59 | | |
63 | | - | |
64 | | - | |
65 | 60 | | |
66 | | - | |
67 | 61 | | |
68 | 62 | | |
69 | 63 | | |
70 | 64 | | |
| 65 | + | |
71 | 66 | | |
72 | 67 | | |
73 | 68 | | |
| |||
92 | 87 | | |
93 | 88 | | |
94 | 89 | | |
| 90 | + | |
95 | 91 | | |
96 | 92 | | |
97 | 93 | | |
| |||
171 | 167 | | |
172 | 168 | | |
173 | 169 | | |
174 | | - | |
175 | | - | |
176 | | - | |
177 | | - | |
178 | | - | |
179 | | - | |
180 | | - | |
181 | | - | |
182 | | - | |
183 | | - | |
184 | | - | |
185 | | - | |
186 | | - | |
187 | | - | |
188 | | - | |
189 | | - | |
190 | | - | |
191 | | - | |
192 | | - | |
193 | | - | |
194 | | - | |
195 | | - | |
196 | | - | |
197 | | - | |
198 | | - | |
199 | | - | |
200 | | - | |
201 | | - | |
202 | | - | |
203 | | - | |
204 | | - | |
205 | | - | |
206 | | - | |
207 | | - | |
208 | | - | |
209 | | - | |
210 | | - | |
211 | | - | |
212 | | - | |
213 | | - | |
| 170 | + | |
| 171 | + | |
| 172 | + | |
| 173 | + | |
| 174 | + | |
| 175 | + | |
| 176 | + | |
| 177 | + | |
| 178 | + | |
| 179 | + | |
| 180 | + | |
| 181 | + | |
| 182 | + | |
| 183 | + | |
214 | 184 | | |
215 | 185 | | |
216 | 186 | | |
| |||
0 commit comments