postgres

package
v0.0.0-...-9d63270 Latest Latest
Warning

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

Go to latest
Published: Aug 19, 2022 License: MIT Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Client

type Client interface {
	// Connect to Postgres
	Connect() error
	// Disconnect from Postgres
	Disconnect() error

	Migrate() error
	Execute(query string, args ...any) error
	Select(query string, args ...any) *sql.Row
}

func NewClient

func NewClient(options *ClientOptions) Client

type ClientOptions

type ClientOptions struct {
	Host     string
	Port     int
	Databse  string
	Username string
	Password string
	SslMode  string
}

func NewClientOptions

func NewClientOptions() *ClientOptions

func (*ClientOptions) SetDatabase

func (o *ClientOptions) SetDatabase(database string) *ClientOptions

func (*ClientOptions) SetHost

func (o *ClientOptions) SetHost(host string) *ClientOptions

func (*ClientOptions) SetPassword

func (o *ClientOptions) SetPassword(password string) *ClientOptions

func (*ClientOptions) SetPort

func (o *ClientOptions) SetPort(port int) *ClientOptions

func (*ClientOptions) SetUsername

func (o *ClientOptions) SetUsername(username string) *ClientOptions

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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