Skip to content

Commit 58f5d33

Browse files
zknprclaude
andcommitted
docs(CLAUDE.md): Update configuration table and add Gotchas section
- Fix defaultPageSize value (500, not 1000) - Add queryTimeout and maxUndoMemory settings - Add Gotchas section documenting common issues: - SQL security (LIKE wildcards, type validation, NUL bytes) - RPC serialization (Uint8Array, Transfer wrapper) - Testing (VS Code mocks, JSON patch tests) - Build (WASM location, browser vs Node detection) Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
1 parent 18b7d89 commit 58f5d33

1 file changed

Lines changed: 22 additions & 1 deletion

File tree

CLAUDE.md

Lines changed: 22 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -296,9 +296,30 @@ Settings in `package.json` → `contributes.configuration`:
296296
|---------|---------|-------------|
297297
| `sqliteExplorer.maxFileSize` | 200 | Max file size in MB (0 = unlimited) |
298298
| `sqliteExplorer.maxRows` | 0 | Max rows to display (0 = unlimited) |
299-
| `sqliteExplorer.defaultPageSize` | 1000 | Default page size for pagination |
299+
| `sqliteExplorer.defaultPageSize` | 500 | Default page size for pagination |
300300
| `sqliteExplorer.instantCommit` | "never" | Auto-save strategy (always/never/remote-only) |
301301
| `sqliteExplorer.doubleClickBehavior` | "inline" | Double-click action (inline/modal/vscode) |
302+
| `sqliteExplorer.queryTimeout` | 30000 | Query execution timeout in ms (prevents runaway queries) |
303+
| `sqliteExplorer.maxUndoMemory` | 52428800 | Max undo history memory in bytes (default 50MB) |
304+
305+
## Gotchas
306+
307+
### SQL Security
308+
- **LIKE wildcards**: User input in LIKE queries must use `escapeLikePattern()` with `ESCAPE '\\'` clause
309+
- **SQL types in DDL**: Always validate with `validateSqlType()` to prevent injection via malicious type strings
310+
- **NUL bytes**: Strings containing `\0` must be encoded as hex blobs in exported SQL
311+
312+
### RPC Serialization
313+
- **Uint8Array becomes `{}`**: Never send raw Uint8Array via postMessage - use the marker format
314+
- **Transfer for blobs**: Large binary data should use `Transfer` wrapper for zero-copy
315+
316+
### Testing
317+
- **VS Code mocks required**: Unit tests need `tests/mocks/vscode.ts` imported first
318+
- **JSON patch tests**: Test behavior (merged result) not implementation (SQL function)
319+
320+
### Build
321+
- **WASM not found**: Run `node scripts/build.mjs` if `assets/sqlite3.wasm` is missing
322+
- **Browser vs Node**: Check `import.meta.env.VSCODE_BROWSER_EXT` for environment-specific code
302323

303324
## Extension Identifiers
304325

0 commit comments

Comments
 (0)