dbutil

package
v0.0.0-...-5163f5a Latest Latest
Warning

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

Go to latest
Published: Jul 8, 2019 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewConnection

func NewConnection(conf DBConf) (db *dbImpl, err error)

func NewFakeConnection

func NewFakeConnection(conf DBConf) (db *dbFake, err error)

Types

type DB

type DB interface {
	Ping() error
	Get(dest interface{}, query string, args ...interface{}) error
	Exec(query string, args ...interface{}) (sql.Result, error)
	Select(dest interface{}, query string, args ...interface{}) error
	Beginx() (Tx, error)
}

type DBConf

type DBConf struct {
	DriverName string
	Conn       string
	MaxIdle    int
	MaxOpen    int
}

type Tx

type Tx interface {
	Select(dest interface{}, query string, args ...interface{}) error
	Get(dest interface{}, query string, args ...interface{}) error
	Exec(query string, args ...interface{}) (sql.Result, error)
	Commit() error
}

Jump to

Keyboard shortcuts

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