Repository navigation
refactor: Use state.db.tables for assistant and run context - #732
Conversation
📝 WalkthroughWalkthroughAcross four files in the CLI UI app, table lists previously derived from Changesdb.tables Migration
Estimated code review effort🎯 2 (Simple) | ⏱️ ~10 minutes Possibly related PRs
Suggested reviewers
Poem
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ 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.
🧹 Nitpick comments (1)
packages/duckdb-core/src/schema-tree/schemaTreeUtils.ts (1)
7-7: ⚡ Quick winMake the deprecation message package-agnostic.
state.db.tablesis an app-store implementation detail; documenting it in apackages/public utility couples this API to one consumer architecture. Reword the deprecation guidance to a generic source of table metadata.Suggested wording
- * `@deprecated` Use state.db.tables + * `@deprecated` Prefer consuming tables from your host application's table catalog/state (for example, a `db.tables` collection) instead of traversing schema trees.As per coding guidelines, "Treat public exports in
packages/as library APIs: keep them generic, composable, documented, and free of app/example-specific assumptions."🤖 Prompt for 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. In `@packages/duckdb-core/src/schema-tree/schemaTreeUtils.ts` at line 7, The deprecation message at line 7 in schemaTreeUtils.ts references "state.db.tables", which is an app-store specific implementation detail that couples this public utility API to a particular consumer architecture. Update the `@deprecated` comment to provide generic guidance that is package-agnostic, such as directing users to a generic source of table metadata instead of a specific application implementation. This ensures the deprecation guidance remains composable and free of app-specific assumptions, consistent with library API best practices for packages/.Source: Coding guidelines
🤖 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.
Nitpick comments:
In `@packages/duckdb-core/src/schema-tree/schemaTreeUtils.ts`:
- Line 7: The deprecation message at line 7 in schemaTreeUtils.ts references
"state.db.tables", which is an app-store specific implementation detail that
couples this public utility API to a particular consumer architecture. Update
the `@deprecated` comment to provide generic guidance that is package-agnostic,
such as directing users to a generic source of table metadata instead of a
specific application implementation. This ensures the deprecation guidance
remains composable and free of app-specific assumptions, consistent with library
API best practices for packages/.
ℹ️ Review info
⚙️ Run configuration
Configuration used: defaults
Review profile: CHILL
Plan: Pro
Run ID: cc8551a1-ac7a-40bf-96df-0c3fb451bdd4
📒 Files selected for processing (5)
apps/sqlrooms-cli-ui/src/components/useAssistantContextItems.tsapps/sqlrooms-cli-ui/src/context/formatRunContextInstructions.tsapps/sqlrooms-cli-ui/src/context/getRunContext.tsapps/sqlrooms-cli-ui/src/workspace/sidebar/CliDataSidebarSection.tsxpackages/duckdb-core/src/schema-tree/schemaTreeUtils.ts
Summary
state.db.tablestoString()identifier consistently for selection and lookupgetAllTablesFromSchemaTreesas deprecated in duckdb-coreTesting
Summary by CodeRabbit