Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -18,3 +18,4 @@ bin
dist
.env
coverage.txt
.idea/
9 changes: 8 additions & 1 deletion pkg/dbdump/mysql/mysql.go
Original file line number Diff line number Diff line change
Expand Up @@ -74,9 +74,16 @@ func (d Dump) Exec(ctx context.Context) error {
// Use a pipe to gzip the output
gzipCmd := exec.CommandContext(ctx, "gzip")
gzipCmd.Stdin, _ = cmd.StdoutPipe()
gzipCmd.Stdout = os.Stdout
gzipCmd.Stderr = os.Stderr

f, err := os.Create(d.DumpName)
if err != nil {
return fmt.Errorf("failed to create dump output file: %w", err)
}

defer f.Close()
gzipCmd.Stdout = f

trace(cmd)
if err := cmd.Start(); err != nil {
return fmt.Errorf("failed to start mysqldump: %w", err)
Expand Down
9 changes: 8 additions & 1 deletion pkg/dbdump/postgres/postgres.go
Original file line number Diff line number Diff line change
Expand Up @@ -75,9 +75,16 @@ func (d Dump) Exec(ctx context.Context) error {
// Use a pipe to gzip the output
gzipCmd := exec.CommandContext(ctx, "gzip")
gzipCmd.Stdin, _ = cmd.StdoutPipe()
gzipCmd.Stdout = os.Stdout
gzipCmd.Stderr = os.Stderr

f, err := os.Create(d.DumpName)
if err != nil {
return fmt.Errorf("failed to create dump output file: %w", err)
}

defer f.Close()
gzipCmd.Stdout = f

trace(cmd)
if err := cmd.Start(); err != nil {
return fmt.Errorf("failed to start pg_dump: %w", err)
Expand Down