Add upload support PG Dump files#102
Conversation
There was a problem hiding this comment.
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 <175728472+Copilot@users.noreply.github.com> Signed-off-by: Vineeth Pothulapati <vineethpothulapati@outlook.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> Signed-off-by: Vineeth Pothulapati <vineethpothulapati@outlook.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> Signed-off-by: Vineeth Pothulapati <vineethpothulapati@outlook.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> Signed-off-by: Vineeth Pothulapati <vineethpothulapati@outlook.com>
|
|
Working example:
Detailed Upload CMD functionality: