postgres

package
v0.0.0-...-c52fe67 Latest Latest
Warning

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

Go to latest
Published: Oct 5, 2020 License: GPL-3.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	Host     string
	Port     string
	Database string
	User     string
	Password string
}

type Handler

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

func New

func New(cfg Config, transactionStore *transactor.Store) *Handler

func NewOptions

func NewOptions(opts *pg.Options, transactionStore *transactor.Store) *Handler

func (*Handler) Begin

func (h *Handler) Begin() (sql.TransactionHandler, error)

func (*Handler) ExecContext

func (h *Handler) ExecContext(c context.Context, query interface{}, params ...interface{}) (orm.Result, error)

func (*Handler) ExecOneContext

func (h *Handler) ExecOneContext(c context.Context, query interface{}, params ...interface{}) (orm.Result, error)

func (*Handler) GetConnection

func (h *Handler) GetConnection() *pg.DB

func (*Handler) ModelContext

func (h *Handler) ModelContext(c context.Context, model ...interface{}) *orm.Query

func (*Handler) QueryContext

func (h *Handler) QueryContext(c context.Context, model, query interface{}, params ...interface{}) (orm.Result, error)

func (*Handler) QueryOneContext

func (h *Handler) QueryOneContext(c context.Context, model, query interface{}, params ...interface{}) (orm.Result, error)

type TransactionHandler

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

func (*TransactionHandler) Commit

func (h *TransactionHandler) Commit() error

func (*TransactionHandler) ExecContext

func (h *TransactionHandler) ExecContext(c context.Context, query interface{}, params ...interface{}) (orm.Result, error)

func (*TransactionHandler) ExecOneContext

func (h *TransactionHandler) ExecOneContext(c context.Context, query interface{}, params ...interface{}) (orm.Result, error)

func (*TransactionHandler) GetConnection

func (h *TransactionHandler) GetConnection() *pg.DB

func (*TransactionHandler) ModelContext

func (h *TransactionHandler) ModelContext(c context.Context, model ...interface{}) *orm.Query

func (*TransactionHandler) QueryContext

func (h *TransactionHandler) QueryContext(c context.Context, model, query interface{}, params ...interface{}) (orm.Result, error)

func (*TransactionHandler) QueryOneContext

func (h *TransactionHandler) QueryOneContext(c context.Context, model, query interface{}, params ...interface{}) (orm.Result, error)

func (*TransactionHandler) Rollback

func (h *TransactionHandler) Rollback() error

Jump to

Keyboard shortcuts

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