Repository navigation
chore: Revert "feat: CLI: Native DuckDB file loading (#409)" - #470
Conversation
This reverts commit bc32e25. Signed-off-by: Ilya Boyandin <[email protected]>
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (1)
🚧 Files skipped from review as they are similar to previous changes (1)
📝 WalkthroughWalkthroughThe changes add server-side file upload to the CLI UI: a new API helper uploads files via FormData to Changes
Sequence Diagram(s)sequenceDiagram
autonumber
participant UI as "CLI UI (Browser)"
participant API as "Server API (/api/upload)"
participant FS as "Server FS / uploads"
UI->>API: POST /api/upload (FormData with file)
API->>FS: store file, generate path
FS-->>API: return stored path
API-->>UI: 200 { "path": "/sqlrooms_uploads/..." }
UI->>UI: validateServerPath() && construct File(name=path)
UI->>Loader: invoke existing loader with server-referenced File
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 minutes Possibly related PRs
Poem
🚥 Pre-merge checks | ✅ 2 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (2 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches
🧪 Generate unit tests (beta)
📝 Coding Plan
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Inline comments:
In `@apps/sqlrooms-cli-ui/src/serverApi.ts`:
- Around line 159-160: The uploaded-path response is trusted via a type
assertion on data.path; validate and sanitize it before returning to prevent SQL
injection when WebSocketDuckDbConnector later interpolates filePath into "SELECT
* FROM read_ipc('${filePath}')". In serverApi.ts, after const data = (await
res.json()) as {path: string}; verify typeof data.path === 'string', normalize
and reject or sanitize any characters outside an allowlist (for example enforce
a regex like /^[A-Za-z0-9_\-./]+$/), and either throw/return an error for
invalid values or return an encoded/escaped safe path (e.g., percent-encode or
remove/escape single quotes) so downstream code using filePath cannot break the
SQL string. Ensure you update callers to handle the validation error
accordingly.
ℹ️ Review info
⚙️ Run configuration
Configuration used: defaults
Review profile: CHILL
Plan: Pro
Run ID: 282fdfd4-651f-4037-83d0-a78eea6bc6a3
📒 Files selected for processing (3)
apps/sqlrooms-cli-ui/src/serverApi.tsapps/sqlrooms-cli-ui/src/store.tspython/sqlrooms-cli/README.md
Signed-off-by: Ilya Boyandin <[email protected]>
Signed-off-by: Ilya Boyandin <[email protected]>
This reverts commit bc32e25 which doesn't work properly.
Summary by CodeRabbit
New Features
Documentation