postgresutil

package
v0.3.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Mar 22, 2022 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type PSQLClient

type PSQLClient struct {
	DatabaseName string
	DatabaseHost string
}

PSQLClient psql client

func NewPSQLClientByHostAndDBName added in v0.2.12

func NewPSQLClientByHostAndDBName(host string, dbname string) *PSQLClient

NewPSQLClientByHostAndDBName returns a new instance of PSQLClient

func NewPSQLClientForSharedDB added in v0.3.0

func NewPSQLClientForSharedDB() *PSQLClient

NewPSQLClientForSharedDB returns a new instance of PSQLClient

func (*PSQLClient) BackUpDBWithData added in v0.2.12

func (p *PSQLClient) BackUpDBWithData(password string, username string, host string, dbname string, debug bool) (string, error)

BackUpDBWithData backs up all tables from a schema using pg_dump

func (*PSQLClient) BackUpSchemaWithData added in v0.3.0

func (p *PSQLClient) BackUpSchemaWithData(password string, username string, host string, dbname string, schemaName string, debug bool) (string, string, error)

BackUpSchemaWithData backs up all tables from a schema using pg_dump

func (*PSQLClient) CreateUser

func (p *PSQLClient) CreateUser(username, password string, debug bool) (string, error)

CreateUser creates postgres user

func (*PSQLClient) CreateUserSchema

func (p *PSQLClient) CreateUserSchema(username string, debug bool) (string, error)

CreateUserSchema creates a schema for the given user

func (*PSQLClient) DropUser

func (p *PSQLClient) DropUser(username string, debug bool) (string, error)

DropUser drops postgres user

func (*PSQLClient) DropUserSchema

func (p *PSQLClient) DropUserSchema(username string, debug bool) (string, error)

DropUserSchema drop schema for the given user

func (*PSQLClient) ExecuteLocalShell added in v0.3.0

func (p *PSQLClient) ExecuteLocalShell(script string, debug bool) (string, error)

ExecuteLocalShell executes local shell script

func (*PSQLClient) ExecutePSQLScriptOverSSH added in v0.3.0

func (p *PSQLClient) ExecutePSQLScriptOverSSH(script string, debug bool) (string, error)

ExecutePSQLScriptOverSSH executes psql script over ssh

func (*PSQLClient) ListDBUsers added in v0.3.0

func (p *PSQLClient) ListDBUsers(debug bool) (string, error)

ListDBUsers list db users

func (*PSQLClient) RestoreSchemaWithData added in v0.2.12

func (p *PSQLClient) RestoreSchemaWithData(password string, username string, host string, dbname string, schemaName string, debug bool) (string, string, error)

RestoreSchemaWithData backs up all tables from a schema using pg_dump

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL