-
Notifications
You must be signed in to change notification settings - Fork 3.2k
feat(tool): added introspection tools for all db integrations #2780
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
|
The latest updates on your projects. Learn more about Vercel for GitHub. |
Greptile OverviewGreptile SummaryThis PR adds introspection capabilities to 8 database integrations (PostgreSQL, MySQL, MongoDB, Neo4j, DynamoDB, RDS, Supabase, Elasticsearch), enabling AI agents to discover database schemas, tables, collections, and relationships. The implementation follows a consistent three-layer architecture: tool configuration files, API route handlers for validation, and utility functions for database-specific introspection logic. Architecture Pattern:
Security Approach: Critical Issue:
Recommendation: Confidence Score: 1/5
Important Files ChangedFile Analysis
Sequence DiagramsequenceDiagram
participant User
participant ToolConfig as Tool Config<br/>(introspect.ts)
participant APIRoute as API Route<br/>(route.ts)
participant Utils as DB Utils<br/>(utils.ts)
participant DB as Database
User->>ToolConfig: Configure introspection tool
Note over ToolConfig: Define params (host, port,<br/>credentials, schema)
User->>ToolConfig: Execute introspection
ToolConfig->>APIRoute: POST /api/tools/{db}/introspect
Note over APIRoute: Validate params with Zod
APIRoute->>Utils: createConnection(config)
Utils->>DB: Establish connection
DB-->>Utils: Connection established
APIRoute->>Utils: executeIntrospect(connection, schema)
loop For each table
Utils->>DB: Query INFORMATION_SCHEMA<br/>(parameterized)
DB-->>Utils: Table metadata
Utils->>DB: Query columns, keys, indexes
DB-->>Utils: Schema details
end
Utils-->>APIRoute: IntrospectionResult
APIRoute->>Utils: connection.close()
Utils->>DB: Close connection
APIRoute-->>ToolConfig: JSON response
ToolConfig-->>User: Schema information
|
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.
1 file reviewed, 1 comment
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.
2 files reviewed, 2 comments
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.
2 files reviewed, 2 comments
Summary
Type of Change
Testing
Tested manually
Checklist