database

package
v0.0.0-...-058eff9 Latest Latest
Warning

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

Go to latest
Published: Feb 13, 2023 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrNoRecordFound     = errors.New("record not found")
	ErrCouldNotBeCreated = errors.New("could not be created in DB")
)

Functions

This section is empty.

Types

type PgxDB

type PgxDB struct {
	Conn *pgxpool.Pool
	// contains filtered or unexported fields
}

func GetPgxConn

func GetPgxConn(dbConnectionString string, maxConnectionsInPool int, log *log.Logger) (*PgxDB, error)

func (*PgxDB) Close

func (db *PgxDB) Close()

Close is a postgres helper function to close the connection to the database

func (*PgxDB) ExecActionQuery

func (db *PgxDB) ExecActionQuery(sql string, arguments ...interface{}) (rowsAffected int, err error)

ExecActionQuery is a postgres helper function for an action query, returning the numbers of rows affected

func (*PgxDB) GetQueryBool

func (db *PgxDB) GetQueryBool(sql string, arguments ...interface{}) (result bool, err error)

GetQueryBool is a postgres helper function for a query expecting an integer result

func (*PgxDB) GetQueryInt

func (db *PgxDB) GetQueryInt(sql string, arguments ...interface{}) (result int, err error)

GetQueryInt is a postgres helper function for a query expecting an integer result

func (*PgxDB) GetQueryString

func (db *PgxDB) GetQueryString(sql string, arguments ...interface{}) (result string, err error)

Jump to

Keyboard shortcuts

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