-
Notifications
You must be signed in to change notification settings - Fork 5
Add upload support PG Dump files #102
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
base: main
Are you sure you want to change the base?
Conversation
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.
Pull Request Overview
This PR adds comprehensive database restore functionality to the tiger CLI, enabling users to restore PostgreSQL/TimescaleDB databases from various dump formats. The implementation includes automatic format detection, TimescaleDB hook support, and cloud-friendly defaults.
Key Changes
- Added restore command (
tiger db restore) with support for multiple dump formats (plain SQL, custom, tar, directory) - Implemented preflight validation, connection management, and progress tracking
- Added TimescaleDB-specific pre/post restore hooks for optimal hypertable restoration
Reviewed Changes
Copilot reviewed 10 out of 10 changed files in this pull request and generated 4 comments.
Show a summary per file
| File | Description |
|---|---|
| internal/tiger/restore/restore.go | Core restore orchestration logic with workflow management |
| internal/tiger/restore/psql.go | Plain SQL restore using psql with statistics collection |
| internal/tiger/restore/pg_restore.go | Custom/tar/directory format restore using pg_restore |
| internal/tiger/restore/preflight.go | Pre-flight validation and service connectivity checks |
| internal/tiger/restore/format.go | Dump format detection from file content and extensions |
| internal/tiger/restore/timescaledb.go | TimescaleDB pre/post restore hook execution |
| internal/tiger/restore/util.go | Utility functions for formatting and error handling |
| internal/tiger/restore/confirm.go | User confirmation prompts for destructive operations |
| internal/tiger/restore/psql_test.go | Unit tests for formatting and pluralization functions |
| internal/tiger/cmd/db.go | CLI command definition with flags and documentation |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Co-authored-by: Copilot <[email protected]> Signed-off-by: Vineeth Pothulapati <[email protected]>
Co-authored-by: Copilot <[email protected]> Signed-off-by: Vineeth Pothulapati <[email protected]>
Co-authored-by: Copilot <[email protected]> Signed-off-by: Vineeth Pothulapati <[email protected]>
Co-authored-by: Copilot <[email protected]> Signed-off-by: Vineeth Pothulapati <[email protected]>
Working example:
Detailed Upload CMD functionality: