Skip to content
Merged
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
2 changes: 1 addition & 1 deletion cmd/dump.go
Original file line number Diff line number Diff line change
Expand Up @@ -315,7 +315,7 @@ S3: If it is a URL of the format s3://bucketname/path then it will connect via S
flags.Bool("safechars", false, "The dump filename usually includes the character `:` in the date, to comply with RFC3339. Some systems and shells don't like that character. If true, will replace all `:` with `-`.")

// compression
flags.String("compression", defaultCompression, "Compression to use. Supported are: `gzip`, `bzip2`")
flags.String("compression", defaultCompression, "Compression to use. Supported are: `gzip`, `bzip2`, `none`")

// source filename pattern
flags.String("filename-pattern", defaultFilenamePattern, "Pattern to use for filename in target. See documentation.")
Expand Down
2 changes: 1 addition & 1 deletion cmd/restore.go
Original file line number Diff line number Diff line change
Expand Up @@ -149,7 +149,7 @@ func restoreCmd(passedExecs execs, cmdConfig *cmdConfiguration) (*cobra.Command,
}

// compression
flags.String("compression", defaultCompression, "Compression to use. Supported are: `gzip`, `bzip2`")
flags.String("compression", defaultCompression, "Compression to use. Supported are: `gzip`, `bzip2`, `none`")

// specific database to which to restore
flags.String("database", "", "Mapping of from:to database names to which to restore, comma-separated, e.g. foo:bar,buz:qux. Replaces the `USE <database>` clauses in a backup file. If blank, uses the file as is.")
Expand Down
2 changes: 1 addition & 1 deletion docs/configuration.md
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ The following are the environment variables, CLI flags and configuration file op
| path-style addressing for S3 bucket instead of default virtual-host-style addressing | BR | `aws-path-style` | `AWS_PATH_STYLE` | `dump.targets[s3-target].pathStyle` | |
| SMB username, used only if a target does not have one | BRP | `smb-user` | `SMB_USER` | `dump.targets[smb-target].username` | |
| SMB password, used only if a target does not have one | BRP | `smb-pass` | `SMB_PASS` | `dump.targets[smb-target].password` | |
| compression to use, one of: `bzip2`, `gzip` | BP | `compression` | `DB_DUMP_COMPRESSION` | `dump.compression` | `gzip` |
| compression to use, one of: `bzip2`, `gzip`, `none` | BP | `compression` | `DB_DUMP_COMPRESSION` | `dump.compression` | `gzip` |
| whether to include triggers, procedures and functions | B | `triggers-and-functions` | `DB_DUMP_TRIGGERS_AND_FUNCTIONS` | `dump.triggersAndFunctions` | `false` |
| when in container, run the dump or restore with `nice`/`ionice` | BR | `` | `NICE` | `` | `false` |
| filename to save the target backup file | B | `dump --filename-pattern` | `DB_DUMP_FILENAME_PATTERN` | `dump.filenamePattern` | |
Expand Down
2 changes: 2 additions & 0 deletions pkg/compression/bzip2.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@ import (
"github.com/dsnet/compress/bzip2"
)

var _ Compressor = &Bzip2Compressor{}

type Bzip2Compressor struct {
}

Expand Down
2 changes: 2 additions & 0 deletions pkg/compression/compressor.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,8 @@ func GetCompressor(name string) (Compressor, error) {
return &GzipCompressor{}, nil
case "bzip2":
return &Bzip2Compressor{}, nil
case "none":
return &NoCompressor{}, nil
default:
return nil, fmt.Errorf("unknown compression format: %s", name)
}
Expand Down
2 changes: 2 additions & 0 deletions pkg/compression/gzip.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@ import (
"io"
)

var _ Compressor = &GzipCompressor{}

type GzipCompressor struct {
}

Expand Down
29 changes: 29 additions & 0 deletions pkg/compression/none.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
package compression

import (
"io"
)

var _ Compressor = &NoCompressor{}

type NoCompressor struct {
}

func (n *NoCompressor) Uncompress(in io.Reader) (io.Reader, error) {
return in, nil
}

func (n *NoCompressor) Compress(out io.Writer) (io.WriteCloser, error) {
return &nopWriteCloser{out}, nil
}
func (n *NoCompressor) Extension() string {
return "tar"
}

type nopWriteCloser struct {
io.Writer
}

func (n *nopWriteCloser) Close() error {
return nil
}