Support streaming PostgreSQL dump and restore - #52
Open
davenquinn with Copilot wants to merge 3 commits into
Open
Support streaming PostgreSQL dump and restore#52davenquinn with Copilot wants to merge 3 commits into
davenquinn with Copilot wants to merge 3 commits into
Conversation
Co-authored-by: davenquinn <1537910+davenquinn@users.noreply.github.com>
Copilot
AI
changed the title
[WIP] Add CLI for Postgres dump and restore to stdout
Support streaming PostgreSQL dump and restore
Sep 3, 2026
davenquinn
requested changes
Sep 3, 2026
davenquinn
left a comment
Member
There was a problem hiding this comment.
Please check that this actually works with print_stdout
| database-transfer --database "$SOURCE_DATABASE" dump -n temp - \ | ||
| | database-transfer --database "$TARGET_DATABASE" restore - | ||
| """ | ||
|
|
Member
There was a problem hiding this comment.
Please move this CLI to the testing area, and convert it to Typer (fitting with Macrostrat's standard practice).
| asyncio.create_task(print_stream_progress(proc.stderr, None)), | ||
| ) | ||
| async def _monitor_stderr(proc): | ||
| await asyncio.gather(print_stdout(proc.stderr), proc.wait()) |
Member
There was a problem hiding this comment.
Check that the print_stdout function actually works for this. I think it is geared to printing for user consumption.
Co-authored-by: davenquinn <1537910+davenquinn@users.noreply.github.com>
Contributor
Author
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Database transfer handlers could not safely stream binary dumps through standard I/O, preventing CLI-level dump/restore pipelines.
Stream-aware transfer handlers
Noneas inherited stdout for dumps and stdin for restores.Basic transfer CLI
database-transferwithdumpandrestorecommands.-to stdout/stdin and support repeated-n/--schemadump filters.