Skip to content

Commit c7e7509

Browse files
committed
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
1 parent 85863ae commit c7e7509

2 files changed

Lines changed: 51 additions & 4 deletions

File tree

docs/docs/configure/warehouses.md

Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -348,6 +348,53 @@ If you're already authenticated via `gcloud`, omit `credentials_path`:
348348
!!! info "Server compatibility"
349349
The ClickHouse driver supports ClickHouse server versions 23.3 and later, covering all non-EOL releases. This includes LTS releases 23.8, 24.3, 24.8, and all stable releases through the current version.
350350

351+
## Oracle
352+
353+
```json
354+
{
355+
"oracle-prod": {
356+
"type": "oracle",
357+
"host": "localhost",
358+
"port": 1521,
359+
"service_name": "ORCL",
360+
"user": "analyst",
361+
"password": "{env:ORACLE_PASSWORD}"
362+
}
363+
}
364+
```
365+
366+
| Field | Required | Description |
367+
|-------|----------|-------------|
368+
| `connection_string` | No | Full connect string (alternative to individual fields, e.g. `host:1521/ORCL`) |
369+
| `host` | No | Hostname (default: `127.0.0.1`) |
370+
| `port` | No | Port (default: `1521`) |
371+
| `service_name` | No | Oracle service name (default: `ORCL`) |
372+
| `database` | No | Alias for `service_name` |
373+
| `user` | No | Username |
374+
| `password` | No | Password |
375+
376+
!!! info "Pure JavaScript driver"
377+
The Oracle driver uses `oracledb` in thin mode (pure JavaScript) — no Oracle Instant Client installation is required.
378+
379+
## SQLite
380+
381+
```json
382+
{
383+
"dev-sqlite": {
384+
"type": "sqlite",
385+
"path": "./dev.sqlite"
386+
}
387+
}
388+
```
389+
390+
| Field | Required | Description |
391+
|-------|----------|-------------|
392+
| `path` | No | Database file path. Omit or use `":memory:"` for in-memory |
393+
| `readonly` | No | Open in read-only mode (default: `false`) |
394+
395+
!!! note
396+
SQLite uses Bun's built-in `bun:sqlite` driver. WAL journal mode is enabled automatically for writable databases.
397+
351398
## SQL Server
352399

353400
```json

packages/drivers/test/clickhouse-unit.test.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -151,14 +151,14 @@ describe("ClickHouse driver unit tests", () => {
151151
test("LIMIT in SQL comment does NOT prevent LIMIT injection", async () => {
152152
mockQueryResult = [{ id: 1 }]
153153
await connector.execute("SELECT * FROM t -- LIMIT 100", 10)
154-
// Should still append LIMIT because the comment-stripped SQL has no LIMIT
155-
expect(mockQueryCalls[0].query).toContain("LIMIT 11")
154+
// Injected LIMIT must be on its own line, NOT inside the trailing comment
155+
expect(mockQueryCalls[0].query).toBe("SELECT * FROM t -- LIMIT 100\nLIMIT 11")
156156
})
157157

158158
test("LIMIT in block comment does NOT prevent LIMIT injection", async () => {
159159
mockQueryResult = [{ id: 1 }]
160160
await connector.execute("SELECT * FROM t /* LIMIT 50 */", 10)
161-
expect(mockQueryCalls[0].query).toContain("LIMIT 11")
161+
expect(mockQueryCalls[0].query).toBe("SELECT * FROM t /* LIMIT 50 */\nLIMIT 11")
162162
})
163163

164164
test("real LIMIT in SQL still prevents double LIMIT", async () => {
@@ -275,7 +275,7 @@ describe("ClickHouse driver unit tests", () => {
275275
test("execute before connect throws clear error", async () => {
276276
const freshConnector = await connect({ host: "localhost" })
277277
// Don't call connect()
278-
expect(freshConnector.execute("SELECT 1")).rejects.toThrow("not connected")
278+
await expect(freshConnector.execute("SELECT 1")).rejects.toThrow("not connected")
279279
})
280280

281281
test("close is idempotent", async () => {

0 commit comments

Comments
 (0)