postgres

package
v0.0.0-...-d482384 Latest Latest
Warning

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

Go to latest
Published: Jan 24, 2021 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Load

func Load(cfg config.Postgres) error

Types

type DBQuery

type DBQuery struct {
	Querier
}

func (*DBQuery) Commit

func (db *DBQuery) Commit() error

func (*DBQuery) Rollback

func (db *DBQuery) Rollback() error

type JsonNullString

type JsonNullString struct {
	sql.NullString
}

func (JsonNullString) MarshalJSON

func (v JsonNullString) MarshalJSON() ([]byte, error)

func (*JsonNullString) UnmarshalJSON

func (v *JsonNullString) UnmarshalJSON(data []byte) error

type Postgres

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

func GetDB

func GetDB() *Postgres

func (Postgres) NewQuery

func (p Postgres) NewQuery() *DBQuery

func (Postgres) NewQueryWithTx

func (p Postgres) NewQueryWithTx() (*DBQuery, error)

type Querier

type Querier interface {
	Exec(query string, args ...interface{}) (sql.Result, error)
	Query(query string, args ...interface{}) (*sql.Rows, error)
	QueryRow(query string, args ...interface{}) *sql.Row
	Prepare(query string) (*sql.Stmt, error)
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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