postgres

package
v0.0.0-...-a8bd786 Latest Latest
Warning

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

Go to latest
Published: Aug 29, 2024 License: MIT Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type EqualStr

type EqualStr string

func (EqualStr) ToSql

func (e EqualStr) ToSql() (sql string, args []interface{}, err error)

type PostgresDB

type PostgresDB struct {
	*pgxpool.Pool
	Sq Squirrel
}

func New

func New(config *config.Config) (*PostgresDB, error)

func (*PostgresDB) Close

func (p *PostgresDB) Close()

func (*PostgresDB) ErrSQLBuild

func (p *PostgresDB) ErrSQLBuild(err error, message string) error

func (*PostgresDB) Error

func (p *PostgresDB) Error(err error) error

type RepoTx

type RepoTx interface {
	Begin(ctx context.Context) (Tx, error)
	TxRollback(ctx context.Context, tx Tx, err error) error
}

type Squirrel

type Squirrel struct {
	Builder squirrel.StatementBuilderType
}

Squirrel provides wrapper around squirrel package

func NewSquirrel

func NewSquirrel() *Squirrel

func (*Squirrel) Alias

func (s *Squirrel) Alias(expr squirrel.Sqlizer, alias string) squirrel.Sqlizer

func (*Squirrel) And

func (s *Squirrel) And(cond ...squirrel.Sqlizer) squirrel.And

func (*Squirrel) Equal

func (s *Squirrel) Equal(key string, value interface{}) squirrel.Eq

func (*Squirrel) EqualMany

func (s *Squirrel) EqualMany(clauses map[string]interface{}) squirrel.Eq

func (*Squirrel) EqualStr

func (s *Squirrel) EqualStr(key string) EqualStr

func (*Squirrel) Expr

func (s *Squirrel) Expr(sql string, args ...interface{}) squirrel.Sqlizer

func (*Squirrel) Gt

func (s *Squirrel) Gt(key string, value interface{}) squirrel.Gt

func (*Squirrel) ILike

func (s *Squirrel) ILike(key string, value interface{}) squirrel.ILike

func (*Squirrel) JSONPathWhere

func (s *Squirrel) JSONPathWhere(fieldName, jsonbOp, searchField, value string) (string, error)

func (*Squirrel) Lt

func (s *Squirrel) Lt(key string, value interface{}) squirrel.Lt

func (*Squirrel) NotEqual

func (s *Squirrel) NotEqual(key string, value interface{}) squirrel.NotEq

func (*Squirrel) Or

func (s *Squirrel) Or(cond ...squirrel.Sqlizer) squirrel.Or

type Tx

type Tx interface {
	pgx.Tx
}

Jump to

Keyboard shortcuts

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