db

package
v0.0.0-...-333ec09 Latest Latest
Warning

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

Go to latest
Published: Dec 30, 2021 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Pool

type Pool struct {
	ConnString string
	Pool       *pgxpool.Pool
}

func (*Pool) CommitOrRollback

func (dbp *Pool) CommitOrRollback(tx pgx.Tx, err *error) (er error)

func (*Pool) Connect

func (dbp *Pool) Connect()

func (*Pool) Exec

func (dbp *Pool) Exec(tx pgx.Tx, query string, values ...interface{}) (tag pgconn.CommandTag, err error)

func (*Pool) GetConnection

func (dbp *Pool) GetConnection() (conn *pgxpool.Conn, err error)

func (*Pool) NewTx

func (dbp *Pool) NewTx(conn *pgxpool.Conn) (tx pgx.Tx, err error)

func (*Pool) SeedDB

func (db *Pool) SeedDB()

TODO: remove seeding and move somewhere else

func (*Pool) Select

func (dbp *Pool) Select(tx pgx.Tx, store interface{}, query string, values ...interface{}) (err error)

Store should be an slice of pointers to a type. For example if we have a type Foo store will be []*Foo

type User

type User struct {
	Id       int
	Username string
	// Might use this later...
	// password         string
	GroupId          int
	GroupName        string
	GroupDescription string
	JWT              string
}

Jump to

Keyboard shortcuts

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