Skip to content

Conversation

@pskrbasu
Copy link

No description provided.

@pskrbasu pskrbasu self-assigned this Oct 29, 2025
@graza-io graza-io requested a review from Copilot October 29, 2025 14:03
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR refactors the database connection mechanism to use Tailpipe initialization SQL scripts instead of direct DuckDB database files. The service now creates an in-memory DuckDB instance and bootstraps it by executing SQL statements from init scripts.

  • Renamed all references from database path to init script path across the codebase
  • Changed DuckDB connection from file-based to in-memory with script execution
  • Upgraded DuckDB dependency from ^1.2.0 to ^1.4.0

Reviewed Changes

Copilot reviewed 6 out of 7 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
src/tools/tailpipe_connect.ts Updated tool to accept init_script_path instead of database_path
src/services/database.ts Refactored to use init scripts and in-memory DuckDB; added script parsing and execution logic
src/resources/status.ts Updated status resource to report init_script_path instead of database path
src/index.ts Changed CLI argument handling from database path to init script path
package.json Upgraded duckdb dependency to ^1.4.0
package-lock.json Updated lock file with new duckdb version and bumped package version to 0.1.1
README.md Updated documentation to reflect init script usage instead of database files
Comments suppressed due to low confidence (2)

src/services/database.ts:96

  • Log message still refers to 'database path' but should refer to 'init script path' to match the refactored terminology.
      logger.info('No database path provided, attempting to use Tailpipe CLI...');

src/services/database.ts:127

  • Error messages still refer to 'database path' but should refer to 'init script path' to match the refactored terminology.
      logger.error('Failed to get database path from Tailpipe CLI:', message);
      throw new Error('Failed to get database path. Please install Tailpipe CLI or provide a database path directly.');

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment on lines +183 to +186
const statements = script
.split(/;\s*\n|;\s*$/m)
.map(s => s.trim())
.filter(s => s.length > 0);
Copy link

Copilot AI Oct 29, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The SQL statement splitting logic may incorrectly split statements that contain semicolons within string literals or comments. For example, INSERT INTO table VALUES ('text; with semicolon') would be incorrectly split. Consider using a more robust SQL parser or add handling for quoted strings and comments.

Copilot uses AI. Check for mistakes.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants