server: fix non default schema are not supported in postgres connector#53
Conversation
📝 WalkthroughWalkthroughThe changes rework table qualification logic in DuckDB SQL processing by replacing string-based dot checking with explicit catalog and schema name handling. Unqualified and partially-qualified tables now receive appropriate catalog prefixes based on provided aliases, with the logic determining qualification based on the presence of catalog_name and schema_name fields. Changes
Estimated code review effort🎯 2 (Simple) | ⏱️ ~15 minutes Poem
🚥 Pre-merge checks | ✅ 1 | ❌ 2❌ Failed checks (2 warnings)
✅ Passed checks (1 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches
🧪 Generate unit tests (beta)
Tip Try Coding Plans. Let us write the prompt for your AI agent so you can ship faster (with fewer bugs). 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 |
|
Claude finished @shreeharsha-factly's task —— View job Code Review for PostgreSQL Schema Qualifier FixReviewing the changes to fix non-default schema support in the PostgreSQL connector. Todo List:
Code Review SummaryThis PR makes important improvements to handle PostgreSQL schema qualification in DuckDB SQL parsing, particularly for non-default schemas. The changes are well-thought-out and address a real limitation. ✅ Strengths
🔍 Technical AnalysisKey Changes Made:
The logic correctly handles:
|
There was a problem hiding this comment.
🧹 Nitpick comments (1)
server/infrastructure/duckdb/duckdbsql/qualifier_test.go (1)
37-79: Consider adding a test for already fully-qualified tables.The current test suite thoroughly covers unqualified and schema-qualified tables. For completeness, consider adding a test case verifying that fully-qualified tables (e.g.,
catalog.schema.table) remain unchanged:{ title: "Fully_Qualified_Table_Unchanged", sql: "SELECT * FROM existing_catalog.analysis.sales", schemaName: "pg_ext_abc", expectedSql: "SELECT * FROM existing_catalog.analysis.sales", },🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@server/infrastructure/duckdb/duckdbsql/qualifier_test.go` around lines 37 - 79, Add a new test case to the testCases slice in qualifier_test.go to ensure fully-qualified table names remain unchanged: create a case with title "Fully_Qualified_Table_Unchanged", sql "SELECT * FROM existing_catalog.analysis.sales", schemaName "pg_ext_abc", and expectedSql "SELECT * FROM existing_catalog.analysis.sales"; append it alongside the existing cases so the test harness (the testCases variable) will validate that catalog.schema.table inputs are preserved by the qualifier logic.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Nitpick comments:
In `@server/infrastructure/duckdb/duckdbsql/qualifier_test.go`:
- Around line 37-79: Add a new test case to the testCases slice in
qualifier_test.go to ensure fully-qualified table names remain unchanged: create
a case with title "Fully_Qualified_Table_Unchanged", sql "SELECT * FROM
existing_catalog.analysis.sales", schemaName "pg_ext_abc", and expectedSql
"SELECT * FROM existing_catalog.analysis.sales"; append it alongside the
existing cases so the test harness (the testCases variable) will validate that
catalog.schema.table inputs are preserved by the qualifier logic.
ℹ️ Review info
⚙️ Run configuration
Configuration used: defaults
Review profile: CHILL
Plan: Pro
Run ID: a0211719-433f-4598-a317-63943093dbdb
📒 Files selected for processing (2)
server/infrastructure/duckdb/duckdbsql/qualifier.goserver/infrastructure/duckdb/duckdbsql/qualifier_test.go
Summary by CodeRabbit
Bug Fixes
Tests