feat: enhance AI scan to skip existing tables#1523
Conversation
There was a problem hiding this comment.
Pull request overview
This PR enhances the AI scan functionality to skip tables that already have settings in the database, avoiding redundant processing. The implementation fetches existing table settings for a connection, filters out tables that already have settings, and only scans new tables.
Changes:
- Added logic to query existing table settings before scanning
- Implemented filtering to skip tables with existing settings
- Added early return when no new tables need scanning
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| connection_id: { | ||
| id: connection.id, | ||
| }, | ||
| }, | ||
| }); | ||
|
|
There was a problem hiding this comment.
The query structure for finding table settings by connection_id is incorrect. The where clause uses a nested object structure connection_id: { id: connection.id }, but based on TypeORM's usage patterns in this codebase, it should directly use the connection ID. The correct structure should be where: { connection_id: connection.id } instead. This will likely cause the query to return no results, making the filtering logic ineffective.
| connection_id: { | |
| id: connection.id, | |
| }, | |
| }, | |
| }); | |
| connection_id: connection.id, | |
| }, | |
| }); |
No description provided.