Support statement types added in DuckDB 1.5.5 - #1437
Conversation
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (3)
🚧 Files skipped from review as they are similar to previous changes (2)
📝 WalkthroughWalkthroughThe change adds support for three DuckDB 1.5.5 statement types. It updates statement-type conversion, adds version-gated prepared-statement tests, and documents the change. ChangesStatement type support
Estimated code review effort: 2 (Simple) | ~10 minutes Possibly related PRs
Suggested reviewers: 🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
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 current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@test/duckdb_test/prepared_statement_test.rb`:
- Around line 144-145: Update the version guard in
test_statement_type_merge_into to skip DuckDB library versions below 1.5.5,
replacing the current 1.5.0 minimum while preserving the existing test behavior
for supported versions.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: defaults
Review profile: CHILL
Plan: Pro Plus
Run ID: ac49f9c2-f902-4eb3-b1c4-2c70f4ca0ab1
📒 Files selected for processing (3)
CHANGELOG.mdlib/duckdb/converter/int_to_sym.rbtest/duckdb_test/prepared_statement_test.rb
duckdb.h v1.5.5 adds DUCKDB_STATEMENT_TYPE_COPY_DATABASE (28), UPDATE_EXTENSIONS (29) and MERGE_INTO (30). Without these entries #statement_type raised "Unknown statement type" for e.g. MERGE INTO. Appending to STATEMENT_TYPES is safe on DuckDB 1.4.5 (LTS): those values are never returned there. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
The skip gate said 1.5.0, but MERGE INTO SQL has existed since 1.4.0 -- what landed in 1.5.5 is the C API mapping (StatementTypeToC gained the COPY_DATABASE / UPDATE_EXTENSIONS / MERGE_INTO cases). On 1.5.0-1.5.4 it falls through to DUCKDB_STATEMENT_TYPE_INVALID, so the test would have failed there. CI only builds 1.4.5 and 1.5.5, so it would not have caught it. Also assert :update_extensions and :copy_database so the array positions of all three new enum values are pinned. COPY FROM DATABASE expands into several statements, so it is prepared via ExtractedStatements. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
517021b to
b701d23
Compare
…es-duckdb-1.5.5 # Conflicts: # CHANGELOG.md
Summary
duckdb.hv1.5.5 adds threeduckdb_statement_typevalues — the only change in the header between v1.5.4 and v1.5.5:DUCKDB_STATEMENT_TYPE_COPY_DATABASE = 28DUCKDB_STATEMENT_TYPE_UPDATE_EXTENSIONS = 29DUCKDB_STATEMENT_TYPE_MERGE_INTO = 30Without them,
#statement_typeraisesDuckDB::Error: Unknown statement type: 30for aMERGE INTOstatement.No new functions or signature changes in the header, so nothing else to bind.
Compatibility
Appending to
STATEMENT_TYPESis safe on DuckDB 1.4.5 (LTS): those integers are never returned there, andstatement_type_to_symonly guards the upper bound. The new test skips on DuckDB < 1.5.0.Test plan
bundle exec rake testagainst DuckDB 1.5.5: 1360 runs, 2621 assertions, 0 failures, 0 errorstest_statement_type_merge_intoasserts:merge_intobundle exec rubocopclean🤖 Generated with Claude Code
Summary by CodeRabbit
New Features
COPY DATABASE,UPDATE EXTENSIONS, andMERGE INTO.Tests
Documentation