-
Notifications
You must be signed in to change notification settings - Fork 5
feat: Add Table/Column Extraction API (closes #63) #90
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
|
Claude finished @ajitpratap0's task —— View job Pull Request ReviewReview Checklist
🔍 Overall Assessment: APPROVE WITH RECOMMENDATIONSThis is a well-engineered addition that provides valuable metadata extraction capabilities. The implementation follows good Go practices and integrates cleanly with the existing codebase. ✅ Strengths1. Clean API Design
2. Robust Implementation
3. Strong Test Coverage
|
…d columns API, parser limitations docs
|
Claude finished @ajitpratap0's task —— View job Pull Request ReviewReview Checklist
🔍 Overall Assessment: APPROVE WITH RECOMMENDATIONSThis is a well-engineered addition that provides valuable metadata extraction capabilities. The implementation follows good Go practices and integrates cleanly with the existing codebase. ✅ Strengths1. Clean API Design
2. Robust Implementation
3. Strong Test Coverage
|
- Fixed nil pointer dereference in TestExtractMetadata_EmptyQuery - Added return statement after nil check to prevent accessing nil pointer - Resolves staticcheck SA5011 warning - All tests pass locally 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
|
Claude finished @ajitpratap0's task —— View job Pull Request ReviewReview Checklist
🔍 Overall Assessment: APPROVE WITH RECOMMENDATIONSThis is a well-engineered addition that provides valuable metadata extraction capabilities. The implementation follows good Go practices and integrates cleanly with the existing codebase. ✅ Strengths1. Clean API Design
2. Robust Implementation
3. Strong Test Coverage
|
Summary
Implements comprehensive metadata extraction API for SQL queries with high-performance visitor-based AST traversal.
Closes #63
Features
ExtractMetadata()for all metadata at onceImplementation Details
New Files Created
pkg/gosqlx/extract.go (694 lines):
ExtractTables()- Extract table names from SQLExtractTablesQualified()- Extract with schema qualifiersExtractColumns()- Extract column referencesExtractFunctions()- Extract function callsExtractMetadata()- Extract all metadata at oncepkg/gosqlx/extract_test.go (769 lines):
pkg/gosqlx/example_test.go (updated):
Supporting Types
Performance Benchmarks
All operations <2μs with zero allocations:
Test Results
Usage Examples
Extract Tables
Extract Columns
Extract All Metadata
Breaking Changes
None - this is a purely additive API.
Migration Guide
No migration needed - new functionality only.
Checklist
🤖 Generated with Claude Code
Co-Authored-By: Claude noreply@anthropic.com