-
Notifications
You must be signed in to change notification settings - Fork 171
feat: implement REMOVE TABLE operation support #2108
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
- Add RemoveTableOperation schema and type guard to table.ts - Implement generateRemoveTableStatement utility function - Support DROP TABLE DDL generation in operationDeparser - Add comprehensive tests for remove table operations - Update existing test to verify DROP TABLE statement generation 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com>
|
The latest updates on your projects. Learn more about Vercel for Git ↗︎
1 Skipped Deployment
|
PR Reviewer Guide 🔍(Review updated until commit 2832784)Here are some key observations to aid the review process:
|
PR Code Suggestions ✨Latest suggestions up to 2832784
Previous suggestionsSuggestions up to commit 2832784
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM!
#2107 is merged, remove the WIP.Issue
Why is this change needed?
This change adds support for the
remove
operation on tables, allowing users to generateDROP TABLE
DDL statements through the operation system. This completes the table operation support alongside the existingadd
operation.What would you like reviewers to focus on?
table.ts
generateRemoveTableStatement
functionTesting Verification
DROP TABLE {tableName};
statementspnpm fmt
,pnpm lint
, andpnpm test
all passWhat was done
🤖 Generated by PR Agent at 2832784
• Add support for REMOVE TABLE operations with DROP TABLE DDL generation
• Implement RemoveTableOperation schema and type guard validation
• Update operation deparser to handle table removal operations
• Add comprehensive test coverage for remove table functionality
Detailed Changes
table.ts
Add RemoveTableOperation schema and type guard
frontend/packages/db-structure/src/operation/schema/table.ts
• Add RemoveTableOperation schema with 'remove' op and table path
validation
• Create isRemoveTableOperation type guard function
•
Export RemoveTableOperation type and update tableOperations array
utils.ts
Add DROP TABLE statement generation utility
frontend/packages/db-structure/src/deparser/postgresql/utils.ts
• Add generateRemoveTableStatement function that creates DROP TABLE
DDL
• Simple implementation returning formatted DROP TABLE statement
operationDeparser.ts
Integrate remove table operation in deparser
frontend/packages/db-structure/src/deparser/postgresql/operationDeparser.ts
• Import RemoveTableOperation type and isRemoveTableOperation guard
•
Add generateRemoveTableFromOperation function with path validation
•
Integrate remove table operation handling in main deparser function
operationDeparser.test.ts
Update test to verify DROP TABLE generation
frontend/packages/db-structure/src/deparser/postgresql/operationDeparser.test.ts
• Update test from expecting error to verifying DROP TABLE generation
• Change test expectations to validate successful DDL output
Additional Notes
This implementation follows the established operation support pattern and maintains consistency with existing table operations. The remove operation only requires a path (no value) since it's a deletion operation.
🤖 Generated with Claude Code