Documentation
¶
Index ¶
- Variables
- type Dump
- func (x *Dump) EnableVerbose()
- func (x *Dump) Exec(opts ExecOptions) Result
- func (x *Dump) GetFileName() string
- func (x *Dump) IgnoreTableDataToString() []string
- func (x *Dump) ResetOptions()
- func (x *Dump) SetFileName(filename string)
- func (x *Dump) SetPath(path string)
- func (x *Dump) SetupFormat(f string)
- type ExecOptions
- type Postgres
- type Restore
- type Result
- type ResultError
- type Results
Constants ¶
This section is empty.
Variables ¶
View Source
var ( // PGDumpCmd is the path to the `pg_dump` executable PGDumpCmd = "pg_dump" PGDumpStdOpts = []string{} PGDumpDefaultFormat = "p" // p c d t )
View Source
var ( // PGRestoreCmd is the path to the `pg_restore` executable PGRestoreCmd = "pg_restore" PGDRestoreStdOpts = []string{"--exit-on-error"} )
Functions ¶
This section is empty.
Types ¶
type Dump ¶
type Dump struct {
*Postgres
// Verbose mode
Verbose bool
// Path: setup path dump out
Path string
// Format: output file format (custom, directory, tar, plain text (default))
Format *string
// Extra pg_dump x.FullOptions
// e.g []string{"--inserts"}
Options []string
IgnoreTableData []string
// contains filtered or unexported fields
}
Dump is an `Exporter` interface that backs up a Postgres database via the `pg_dump` command.
func (*Dump) EnableVerbose ¶
func (x *Dump) EnableVerbose()
func (*Dump) Exec ¶
func (x *Dump) Exec(opts ExecOptions) Result
Exec `pg_dump` of the specified database, and creates a gzip compressed tarball archive.
func (*Dump) GetFileName ¶
func (*Dump) IgnoreTableDataToString ¶
func (*Dump) ResetOptions ¶
func (x *Dump) ResetOptions()
func (*Dump) SetFileName ¶
func (*Dump) SetupFormat ¶
type ExecOptions ¶
type ExecOptions struct {
StreamPrint bool
}
type Postgres ¶
type Restore ¶
type Restore struct {
*Postgres
// Verbose mode
Verbose bool
// Role: do SET ROLE before restore
Role string
// Path: setup path for source restore
Path string
// Extra pg_dump options
// e.g []string{"--inserts"}
Options []string
// Schemas: list of database schema
Schemas []string
}
func NewRestore ¶
func (*Restore) EnableVerbose ¶
func (x *Restore) EnableVerbose()
func (*Restore) Exec ¶
func (x *Restore) Exec(filename string, opts ExecOptions) Result
Exec `pg_restore` of the specified database, and restore from a gzip compressed tarball archive.
func (*Restore) ResetOptions ¶
func (x *Restore) ResetOptions()
func (*Restore) SetSchemas ¶
type Result ¶
type Result struct {
Mine string
File string
Output string
Error *ResultError
FullCommand string
}
type ResultError ¶
Directories
¶
| Path | Synopsis |
|---|---|
|
tests
|
|
|
fixtures/scripts/init-database
command
|
|
|
fixtures/scripts/install-deps
command
|
Click to show internal directories.
Click to hide internal directories.