You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
feat: adopt DuckDB 2.0 with workspace compatibility guards - #959
DuckDB 2.0 can serialize modifying CTEs beneath a SELECT and creates new database files that older engines cannot read by default. Upgrade the shared SQLRooms/Roomie runtime while preserving an explicit portable-file policy and checking protected query consumers before execution.
Require DuckDB 2.0.x and Python 3.11+ consistently across the Python workspace and Roomie; regenerate the lockfile.
Create runtime workspaces and attached metadata with v1.4.0 storage compatibility. Existing files retain their format; document feature limitations and backup/rollback requirements.
Add a shared recursive AST guard for AI read-only tools, MCP, HTML apps, Python SQL bridge, and table materialization. Preserve writable SQL editor execution and classify modifying CTEs as writes. Check full nested namespace paths.
Add a CI compatibility check and a verification record with exact versions, support limitations and raw runtime benchmarks. Quack remains a later phase.
Validation on macOS arm64 / Python 3.12.9 / Node 24.19:
All 50 workspace packages and both production UIs built.
SQLRooms Python: 339 passed in the full run; subsequent focused launcher/compatibility run: 70 passed; final compatibility suite including sync restart: 9 passed. Roomie Python: 43 passed.
Real 1.5.6 and 2.0.0 parser contracts; older Python 1.4.4/1.5.6, Node 1.4.4 and actual WASM 1.4.3 file readers.
Chromium CSV import, document/table/chart rendering and reload, HTML iframe; two-client sync broadcast and snapshot persistence.
Clean SQLRooms wheel/sdist and paired Roomie wheel installation/startup/persistence checks.
Affected-package ESLint, changed-file Prettier, focused Ruff and diff checks passed.
Local Git hooks force Volta Node 22 despite the repository's Node 24 requirement. Commit/push hooks were bypassed after the explicit checks above; their full repository-wide pre-push suite was not run. Linux and other platform results depend on CI/release checks; optional community extensions and the complete RAG embedding/VSS workflow remain unverified.
Summary by CodeRabbit
New Features
Added comprehensive read-only SQL validation across query tools, runtime execution, SQL editing, MCP, and Python APIs.
Data-modifying CTEs and unknown SQL structures are now rejected from read-only workflows.
Added DuckDB 2.0 compatibility, including safer storage compatibility for new workspaces and improved Arrow/VARIANT handling.
Documentation
Added DuckDB 2.0 upgrade, compatibility, rollback, and query-safety guidance.
Breaking Changes
Python support now requires version 3.11 or newer.
Included review availability: This review used your included allowance. Your plan provides up to 4 included reviews per hour; 3 remain after this review.
📝 Walkthrough
The changes add a shared validator for serialized SQL query trees and use it across TypeScript and Python query paths. They also update Python runtime compatibility behavior, DuckDB and Python version requirements, tests, and DuckDB 2.0 compatibility documentation.
Changes: DuckDB 2.0 compatibility and read-only SQL validation
Uses the shared validator in query tools, the app runtime, DuckDB table creation, the SQL editor, and the Python SQL bridge. Tests verify that data-modifying CTEs are rejected before authorization or execution.
MCP local SQL policy packages/mcp/src/localSqlPolicy.ts, packages/mcp/__tests__/*, packages/mcp/package.json, packages/mcp/README.md, turbo.json
Applies the validator to MCP SQL inspection and checks qualified paths when classifying internal tables and functions. DuckDB-serialized tests cover local-read approval and fail-closed rejection cases.
Python query and result compatibility python/sqlrooms/sqlrooms/server/*, python/sqlrooms/sqlrooms/web/launcher.py, python/sqlrooms/tests/*
Adds recursive SQL AST validation before project-query execution, rejects Arrow schemas containing VARIANT fields, and configures storage compatibility as v1.4.0. Tests cover query behavior, Arrow conversion, persistence, and older DuckDB readers.
DuckDB 2.0 versioning and verification python/*/pyproject.toml, python/*/README.md, python/sqlrooms/DUCKDB_COMPATIBILITY.md, dev-docs/verification/*, .github/workflows/pr-checks-python.yml
Raises Python minimum requirements to 3.11 and updates DuckDB constraints to 2.0.x. Adds compatibility guidance, verification results, benchmark measurements, and CI checks.
sequenceDiagram
participant Runtime as executeReadonlyQuery
participant QueryState as sqlSelectToJson
participant Validator as isReadOnlySqlSelect
participant Authorization as authorizeQuery
participant Database as runQuery
Runtime->>QueryState: Parse SQL and return serialized statements
Runtime->>Validator: Validate the parsed query tree
alt Read-only query
Runtime->>Authorization: Authorize query
Runtime->>Database: Execute query
else Non-read-only query
Runtime-->>Runtime: Reject before authorization or execution
end
Loading
Merge Risk:⚪ Minimal · up to 8eb7a
No confirmed issue blocks merging. The reported older-reader compatibility failure remains unverified.
Pre-merge checks: 4 · 1
Failed checks: 1 warning
Check name
Status
Explanation
Resolution
Docstring Coverage
Docstring coverage is 23.68% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 38 functions across 20 files. (23 skipped…
Write docstrings for the functions missing them to satisfy the coverage threshold.
Passed checks: 4 passed
Check name
Status
Explanation
Description Check
Check skipped - CodeRabbit’s high-level summary is enabled.
Title check
The title clearly and concisely describes the primary changes: adopting DuckDB 2.0 and adding workspace compatibility guards.
Linked Issues check
Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check
Check skipped because no linked issues were found for this pull request.
Full details: Docstring Coverage
Explanation
Docstring coverage is 23.68% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 38 functions across 20 files. (23 skipped: 23 unsupported.)
Resolution
Write docstrings for the functions missing them to satisfy the coverage threshold.
✨ Finishing Touches: 💡 2
📝 Generate docstrings: 💡
Commit to this branch
Create a new PR
🛠️ Fix failing CI checks: 💡
Commit to this branch
Create a new PR
🧪 Generate unit tests (beta)
Commit to this branch
Create a new PR
Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts
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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
DuckDB 2.0 can serialize modifying CTEs beneath a SELECT and creates new database files that older engines cannot read by default. Upgrade the shared SQLRooms/Roomie runtime while preserving an explicit portable-file policy and checking protected query consumers before execution.
v1.4.0storage compatibility. Existing files retain their format; document feature limitations and backup/rollback requirements.Validation on macOS arm64 / Python 3.12.9 / Node 24.19:
Local Git hooks force Volta Node 22 despite the repository's Node 24 requirement. Commit/push hooks were bypassed after the explicit checks above; their full repository-wide pre-push suite was not run. Linux and other platform results depend on CI/release checks; optional community extensions and the complete RAG embedding/VSS workflow remain unverified.
Summary by CodeRabbit
New Features
Documentation
Breaking Changes