Commit 5d0ada3
authored
fix: address 7 P1 findings from v0.5.16 release evaluation (#591)
* fix: address 7 P1 findings from v0.5.16 release evaluation (#590)
ClickHouse driver:
- Silently ignore `binds` param (was throwing, inconsistent with other drivers)
- Strip SQL comments before LIMIT check to prevent `-- LIMIT` bypass
- Remove redundant `hasDML` regex (dead code after `isDDL` routing)
- Replace fragile `position(type, 'Nullable')` SQL with TS regex on type string
- Add connection guard: `execute()` before `connect()` throws clear error
Query history:
- Rename `{days:UInt32}` placeholders to `__DAYS__`/`__LIMIT__` to avoid
confusion with ClickHouse native query parameter syntax
Docs:
- Update warehouse count from 10 to 12
Tests:
- Add 39 unit tests for ClickHouse driver (DDL routing, LIMIT injection,
truncation, nullable, connection lifecycle, binds, column mapping)
- Remove stale "ClickHouse unsupported" test
* fix: address code review findings for ClickHouse driver (#592)
SQL parsing hardening (from 6-model consensus review):
- Strip string literals before comments to prevent false matches
- Run `supportsLimit` and `isDDL` on cleaned SQL (fixes leading comment bypass)
- Append LIMIT with newline instead of space (fixes trailing comment bypass)
Nullable detection:
- Fix `LowCardinality(Nullable(T))` regression — `LowCardinality` is a storage
optimization, not a semantic wrapper; column IS nullable
Tests:
- Fix `LowCardinality(Nullable(String))` assertion to `true`
- Add `LowCardinality(String)` non-nullable test
- Add trailing comment, leading comment, string literal LIMIT bypass tests
- Remove residual no-op comment in `driver-security.test.ts`
* fix: address CodeRabbit PR comments — docs, test assertions, await
- Add Oracle and SQLite docs sections to warehouses.md (were supported
but undocumented, making "12 warehouse types" claim incomplete)
- Use strict `toBe` assertions for LIMIT comment bypass tests to verify
exact query shape (not just substring)
- Add missing `await` on `rejects.toThrow` to prevent flaky test
* fix: add connection guards to listSchemas, listTables, describeTable
Add consistent not-connected guard to all ClickHouse query methods,
matching the guard already present in execute(). Without this, calling
these methods before connect() would throw an unhelpful TypeError
instead of a clear error message.
* fix: handle doubled-quote string escaping in SQL cleaning regex
The string literal stripping regex now handles ClickHouse's doubled-quote
escape convention (`'it''s'`) in addition to backslash escaping (`\'`).
* test: add WITH...SELECT LIMIT injection tests
Cover the CTE branch of LIMIT injection logic — both appending LIMIT
to a bare WITH...SELECT and skipping when one already exists.1 parent 99270e5 commit 5d0ada3
File tree
5 files changed
+446
-28
lines changed- docs/docs/configure
- packages
- drivers
- src
- test
- opencode/src/altimate/native/finops
5 files changed
+446
-28
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | 2 | | |
3 | | - | |
| 3 | + | |
4 | 4 | | |
5 | 5 | | |
6 | 6 | | |
| |||
348 | 348 | | |
349 | 349 | | |
350 | 350 | | |
| 351 | + | |
| 352 | + | |
| 353 | + | |
| 354 | + | |
| 355 | + | |
| 356 | + | |
| 357 | + | |
| 358 | + | |
| 359 | + | |
| 360 | + | |
| 361 | + | |
| 362 | + | |
| 363 | + | |
| 364 | + | |
| 365 | + | |
| 366 | + | |
| 367 | + | |
| 368 | + | |
| 369 | + | |
| 370 | + | |
| 371 | + | |
| 372 | + | |
| 373 | + | |
| 374 | + | |
| 375 | + | |
| 376 | + | |
| 377 | + | |
| 378 | + | |
| 379 | + | |
| 380 | + | |
| 381 | + | |
| 382 | + | |
| 383 | + | |
| 384 | + | |
| 385 | + | |
| 386 | + | |
| 387 | + | |
| 388 | + | |
| 389 | + | |
| 390 | + | |
| 391 | + | |
| 392 | + | |
| 393 | + | |
| 394 | + | |
| 395 | + | |
| 396 | + | |
| 397 | + | |
351 | 398 | | |
352 | 399 | | |
353 | 400 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
60 | 60 | | |
61 | 61 | | |
62 | 62 | | |
63 | | - | |
64 | | - | |
65 | | - | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
66 | 66 | | |
67 | 67 | | |
68 | 68 | | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
69 | 78 | | |
70 | | - | |
| 79 | + | |
71 | 80 | | |
72 | | - | |
73 | | - | |
| 81 | + | |
74 | 82 | | |
75 | 83 | | |
76 | 84 | | |
| |||
79 | 87 | | |
80 | 88 | | |
81 | 89 | | |
82 | | - | |
83 | | - | |
84 | | - | |
| 90 | + | |
| 91 | + | |
| 92 | + | |
85 | 93 | | |
86 | 94 | | |
87 | 95 | | |
| |||
108 | 116 | | |
109 | 117 | | |
110 | 118 | | |
| 119 | + | |
| 120 | + | |
| 121 | + | |
111 | 122 | | |
112 | 123 | | |
113 | 124 | | |
| |||
117 | 128 | | |
118 | 129 | | |
119 | 130 | | |
| 131 | + | |
| 132 | + | |
| 133 | + | |
120 | 134 | | |
121 | 135 | | |
122 | 136 | | |
| |||
133 | 147 | | |
134 | 148 | | |
135 | 149 | | |
| 150 | + | |
| 151 | + | |
| 152 | + | |
136 | 153 | | |
137 | | - | |
138 | | - | |
| 154 | + | |
139 | 155 | | |
140 | 156 | | |
141 | 157 | | |
| |||
147 | 163 | | |
148 | 164 | | |
149 | 165 | | |
150 | | - | |
| 166 | + | |
| 167 | + | |
| 168 | + | |
151 | 169 | | |
152 | 170 | | |
153 | 171 | | |
| |||
0 commit comments