Documentation ¶
Index ¶
- Constants
- Variables
- func Exec(name string, arg ...string) (string, error)
- func IsAdminUser(db *sql.DB) (bool, error)
- func SanitizeDSN(dsn string) string
- type Config
- type Dump
- func (x *Dump) EnableVerbose()
- func (x *Dump) Exec(opts ExecOptions) Result
- func (x *Dump) GetFileName() string
- func (x *Dump) GetOptions() []string
- func (x *Dump) ResetOptions()
- func (x *Dump) SetFileName(filename string)
- func (x *Dump) SetOptions(o []string)
- func (x *Dump) SetPath(path string)
- func (x *Dump) SetupFormat(f string)
- type ExecOptions
- type ExportFile
- type Restore
- func (x *Restore) DropSchemas() Result
- func (x *Restore) EnableVerbose()
- func (x *Restore) Exec(filename string, opts ExecOptions) Result
- func (x *Restore) GetOptions() []string
- func (x *Restore) ResetOptions()
- func (x *Restore) SetOptions(o []string)
- func (x *Restore) SetPath(path string)
- func (x *Restore) SetSchemas(schemas []string)
- type Result
- type ResultError
- type Results
- type State
- type StateEnum
Constants ¶
View Source
const ( DefaultPubName = "dbc_temp_pub_for_upgrade" DefaultSubName = "dbc_temp_sub_for_upgrade" )
Variables ¶
View Source
var ( PGDump = "pg_dump" PGDumpOpts = []string{} PGDumpDefaultFormat = "p" )
View Source
var ( PSQL = "psql" PGDRestoreOpts = []string{} )
Functions ¶
func IsAdminUser ¶ added in v1.10.0
IsAdminUser checks if the user is a superuser or has replication role
func SanitizeDSN ¶ added in v1.10.0
Types ¶
type Dump ¶
type Dump struct { DsnUri string Verbose bool Path string Format *string Options []string // contains filtered or unexported fields }
func (*Dump) EnableVerbose ¶
func (x *Dump) EnableVerbose()
func (*Dump) Exec ¶
func (x *Dump) Exec(opts ExecOptions) Result
func (*Dump) GetFileName ¶
func (*Dump) GetOptions ¶
func (*Dump) ResetOptions ¶
func (x *Dump) ResetOptions()
func (*Dump) SetFileName ¶
func (*Dump) SetOptions ¶
func (*Dump) SetupFormat ¶
type ExecOptions ¶
type ExecOptions struct {
StreamPrint bool
}
type ExportFile ¶
type Restore ¶
func NewRestore ¶
NewRestore creates a new Restore instance with the provided configuration.
func (*Restore) DropSchemas ¶ added in v1.10.0
DropSchemas drops all schemas except the system ones.
func (*Restore) EnableVerbose ¶
func (x *Restore) EnableVerbose()
func (*Restore) Exec ¶
func (x *Restore) Exec(filename string, opts ExecOptions) Result
Exec runs the pg_restore command with the provided filename and options.
func (*Restore) GetOptions ¶
func (*Restore) ResetOptions ¶
func (x *Restore) ResetOptions()
func (*Restore) SetOptions ¶
func (*Restore) SetSchemas ¶
type Result ¶
type Result struct { Mine string FileName string Output string Error *ResultError FullCommand string }
type ResultError ¶
type StateEnum ¶
type StateEnum int
const ( S_Initial StateEnum = iota S_ValidateConnection S_CreatePublication S_CopySchema S_CreateSubscription S_EnableSubscription S_CutOverReadinessCheck S_ResetTargetSequence S_RerouteTargetSecret S_WaitToDisableSource S_DisableSourceAccess S_MigrationInProgress S_ValidateMigrationStatus S_DisableSubscription S_DeleteSubscription S_DeletePublication S_Completed S_Retry )
func GetStateEnum ¶
Click to show internal directories.
Click to hide internal directories.