postgresutil

package
v0.2.13 Latest Latest
Warning

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

Go to latest
Published: Mar 5, 2022 License: Apache-2.0 Imports: 4 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 NewPSQLClient

func NewPSQLClient() *PSQLClient

NewPSQLClient returns a new instance of PSQLClient

func NewPSQLClientByHostAndDBName added in v0.2.12

func NewPSQLClientByHostAndDBName(host string, dbname string) *PSQLClient

NewPSQLClientByHostAndDBName 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) BackUpSchemaOnlyWithData added in v0.2.12

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

BackUpSchemaOnlyWithData backs up all tables from a schema using pg_dump

func (*PSQLClient) CreateUser

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

CreateUser creates postgres user

func (*PSQLClient) CreateUserSchema

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

CreateUserSchema creates a schema for the given user

func (*PSQLClient) DropUser

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

DropUser drops postgres user

func (*PSQLClient) DropUserSchema

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

DropUserSchema drop schema for the given user

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, 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