databases

package
v0.0.0-...-7323e91 Latest Latest
Warning

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

Go to latest
Published: Sep 5, 2024 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

View Source
const (
	POSTGRES_DEFAULT_DOCKER_IMAGE    = "postgres"
	POSTGRES_DEFAULT_PORT            = 5432
	POSTGRES_DEFAULT_PASSWORD        = ""
	POSTGRES_DEFAULT_COMMAND_DUMP    = "pg_dump"
	POSTGRES_DEFAULT_COMMAND_RESTORE = "psql"
	POSTGRES_DEFAULT_COMMAND_QUERY   = "psql"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Database

type Database interface {
	Dump(bool, string) (string, error)
	Restore(string) (bool, error)
	RunQuery(string) (string, error)
}

func ParseUrl

func ParseUrl(urlString string) (Database, error)

type PostgresDatabase

type PostgresDatabase struct {
	Protocol string
	Username string
	Password string
	Host     string
	Port     int
	Database string
	Query    string
}

func (PostgresDatabase) Dump

func (db PostgresDatabase) Dump(isTemporary bool, dir string) (string, error)

func (PostgresDatabase) Restore

func (db PostgresDatabase) Restore(fileName string) (bool, error)

func (PostgresDatabase) RunQuery

func (db PostgresDatabase) RunQuery(query string) (string, error)

Jump to

Keyboard shortcuts

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