sqlex

package
v0.0.0-...-c5fdaab Latest Latest
Warning

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

Go to latest
Published: May 7, 2020 License: BSD-3-Clause Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type DB

type DB struct {
	*sqlx.DB
	// contains filtered or unexported fields
}

func MustOpen

func MustOpen(driver, dsn string) *DB

func Open

func Open(driver, dsn string) (*DB, error)

func (*DB) Exec

func (db *DB) Exec(query string, args ...interface{}) (sql.Result, error)

func (*DB) Get

func (db *DB) Get(dest interface{}, query string, args ...interface{}) (err error)

func (*DB) NamedExec

func (db *DB) NamedExec(query string, arg interface{}) (sql.Result, error)

func (*DB) NamedQuery

func (db *DB) NamedQuery(query string, arg interface{}) (rows *sqlx.Rows, err error)

func (*DB) Query

func (db *DB) Query(query string, args ...interface{}) (*sql.Rows, error)

func (*DB) QueryRowx

func (db *DB) QueryRowx(query string, args ...interface{}) *sqlx.Row

func (*DB) Queryx

func (db *DB) Queryx(query string, args ...interface{}) (*sqlx.Rows, error)

func (*DB) Select

func (db *DB) Select(dest interface{}, query string, args ...interface{}) (err error)

func (*DB) SetLogger

func (db *DB) SetLogger(logger Logger)

type Logger

type Logger interface {
	Log(duration time.Duration, query string, args ...interface{})
}
var StdLogger Logger = &logger{}

type NullString

type NullString struct {
	sql.NullString
}

func ToNullString

func ToNullString(s string) NullString

func (*NullString) MarshalJSON

func (n *NullString) MarshalJSON() ([]byte, error)

func (NullString) UnmarshalJSON

func (n NullString) UnmarshalJSON(data []byte) error

type NullTime

type NullTime struct {
	sql.NullTime
}

func ToNullTime

func ToNullTime(t time.Time) NullTime

func (*NullTime) MarshalJSON

func (n *NullTime) MarshalJSON() ([]byte, error)

func (NullTime) UnmarshalJSON

func (n NullTime) UnmarshalJSON(data []byte) error

Jump to

Keyboard shortcuts

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