pg

package
v0.1.7 Latest Latest
Warning

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

Go to latest
Published: Mar 19, 2024 License: GPL-3.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var InvalidOption = errors.New("invalid role option")

Functions

func FormattedString

func FormattedString(s string) string

func Initialize

func Initialize(logger *zap.SugaredLogger)

Types

type Conn

type Conn struct {
	// contains filtered or unexported fields
}

func NewConn

func NewConn(connParams Dsn, retries uint, delay time.Duration) (c *Conn)

func (*Conn) Connect

func (c *Conn) Connect() (err error)

func (*Conn) DSN

func (c *Conn) DSN() (dsn string)

func (*Conn) RunQuery

func (c *Conn) RunQuery(query string, args ...interface{}) (result Results, err error)

type Dsn

type Dsn map[string]string

type Result

type Result struct {
	// contains filtered or unexported fields
}

func NewResultFromByteArrayArray

func NewResultFromByteArrayArray(cols []string, values []interface{}) (r Result, err error)

func (Result) Columns

func (r Result) Columns() (cols []string)

func (Result) Compare

func (r Result) Compare(other Result) (err error)

func (Result) KeyValueStrings added in v0.1.5

func (r Result) KeyValueStrings() (vals []string)

func (Result) OneField

func (r Result) OneField() (rv ResultValue, err error)

func (Result) String

func (r Result) String() (s string)

func (Result) Values added in v0.1.5

func (r Result) Values() (vals []string)

type ResultValue

type ResultValue struct {
	// contains filtered or unexported fields
}

func NewResultValue

func NewResultValue(org interface{}) ResultValue

func (*ResultValue) AsFloat

func (rv *ResultValue) AsFloat() (float64, error)

func (*ResultValue) AsString

func (rv *ResultValue) AsString() string

func (*ResultValue) Formatted

func (rv *ResultValue) Formatted() string

func (*ResultValue) Org

func (rv *ResultValue) Org() interface{}

type Results

type Results []Result

func (Results) Compare

func (rs Results) Compare(other Results) (err error)

func (Results) OneField

func (rs Results) OneField() (rv ResultValue, err error)

func (Results) RowsKeyValues added in v0.1.5

func (rs Results) RowsKeyValues() []string

func (Results) String

func (rs Results) String() (s string)

Jump to

Keyboard shortcuts

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