postgres

package
v0.0.0-...-778623d Latest Latest
Warning

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

Go to latest
Published: May 1, 2024 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

View Source
const DefaultConnectDatabase = "postgres"

Variables

This section is empty.

Functions

This section is empty.

Types

type Client

type Client struct {
	*sql.DB
}

Client is postgres client to access postgres instance

func NewClient

func NewClient(host, username, password, database, sslMode string) (*Client, error)

NewClient initializes postgres client

func (Client) ListDatabases

func (pg Client) ListDatabases(ctx context.Context) ([]string, error)

ListDatabases returns list of databases in postgres

func (Client) PingDB

func (pg Client) PingDB(ctx context.Context) error

PingDB tests db connection

Jump to

Keyboard shortcuts

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