Documentation ¶
Index ¶
- func Commit(ctx context.Context, tx *sqlx.Tx, err error) error
- func IsDuplicateKey(err error) bool
- func Rollback(ctx context.Context, tx *sqlx.Tx, err error) error
- type PSQLHandler
- func (t *PSQLHandler) Close()
- func (t *PSQLHandler) DB() *sqlx.DB
- func (t *PSQLHandler) Delete(ctx context.Context, query string, params ...interface{}) (int64, error)
- func (t *PSQLHandler) Get(ctx context.Context, result interface{}, query string, params ...interface{}) error
- func (t *PSQLHandler) GetById(ctx context.Context, result interface{}, query string, id interface{}) error
- func (t *PSQLHandler) Host() string
- func (t *PSQLHandler) Insert(ctx context.Context, query string, params ...interface{}) error
- func (t *PSQLHandler) InsertWithId(ctx context.Context, query string, params ...interface{}) (int64, error)
- func (t *PSQLHandler) Name() string
- func (t *PSQLHandler) Ping() error
- func (t *PSQLHandler) Port() string
- func (t *PSQLHandler) Select(ctx context.Context, results interface{}, query string, params ...interface{}) error
- func (t *PSQLHandler) Update(ctx context.Context, query string, params ...interface{}) (int64, error)
- type SSLMode
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func IsDuplicateKey ¶
Types ¶
type PSQLHandler ¶
type PSQLHandler struct {
// contains filtered or unexported fields
}
func NewPSQLDBHandler ¶
func NewPSQLDBHandler(host, dbname, user, password string, port int, sslmode SSLMode) (*PSQLHandler, error)
Postgres Connection Object. Wraps a sqlx.DB and provides a DBConnection() method to access the DB Connection
func NewPSQLDBHandlerFromString ¶
func NewPSQLDBHandlerFromString(str string) (*PSQLHandler, error)
func (*PSQLHandler) Close ¶
func (t *PSQLHandler) Close()
func (*PSQLHandler) DB ¶
func (t *PSQLHandler) DB() *sqlx.DB
func (*PSQLHandler) Get ¶
func (t *PSQLHandler) Get(ctx context.Context, result interface{}, query string, params ...interface{}) error
func (*PSQLHandler) GetById ¶
func (t *PSQLHandler) GetById(ctx context.Context, result interface{}, query string, id interface{}) error
func (*PSQLHandler) Host ¶
func (t *PSQLHandler) Host() string
func (*PSQLHandler) Insert ¶
func (t *PSQLHandler) Insert(ctx context.Context, query string, params ...interface{}) error
func (*PSQLHandler) InsertWithId ¶
func (*PSQLHandler) Name ¶
func (t *PSQLHandler) Name() string
func (*PSQLHandler) Ping ¶
func (t *PSQLHandler) Ping() error
func (*PSQLHandler) Port ¶
func (t *PSQLHandler) Port() string
Click to show internal directories.
Click to hide internal directories.