sqlc

package
v1.0.26 Latest Latest
Warning

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

Go to latest
Published: Nov 8, 2020 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrNotFound = sqlx.ErrNotFound
)

Functions

This section is empty.

Types

type CachedConn

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

func NewConn

func NewConn(db sqlx.SqlConn, c cache.CacheConf, opts ...cache.Option) CachedConn

func NewNodeConn

func NewNodeConn(db sqlx.SqlConn, rds *redis.Redis, opts ...cache.Option) CachedConn

func (CachedConn) DelCache

func (cc CachedConn) DelCache(keys ...string) error

func (CachedConn) Exec

func (cc CachedConn) Exec(exec ExecFn, keys ...string) (sql.Result, error)

func (CachedConn) ExecNoCache

func (cc CachedConn) ExecNoCache(q string, args ...interface{}) (sql.Result, error)

func (CachedConn) GetCache

func (cc CachedConn) GetCache(key string, v interface{}) error

func (CachedConn) QueryRow

func (cc CachedConn) QueryRow(v interface{}, key string, query QueryFn) error

func (CachedConn) QueryRowIndex

func (cc CachedConn) QueryRowIndex(v interface{}, key string, keyer func(primary interface{}) string,
	indexQuery IndexQueryFn, primaryQuery PrimaryQueryFn) error

func (CachedConn) QueryRowNoCache

func (cc CachedConn) QueryRowNoCache(v interface{}, q string, args ...interface{}) error

func (CachedConn) QueryRowsNoCache

func (cc CachedConn) QueryRowsNoCache(v interface{}, q string, args ...interface{}) error

QueryRowsNoCache doesn't use cache, because it might cause consistency problem.

func (CachedConn) SetCache

func (cc CachedConn) SetCache(key string, v interface{}) error

func (CachedConn) Transact

func (cc CachedConn) Transact(fn func(sqlx.Session) error) error

type ExecFn

type ExecFn func(conn sqlx.SqlConn) (sql.Result, error)

type IndexQueryFn

type IndexQueryFn func(conn sqlx.SqlConn, v interface{}) (interface{}, error)

type PrimaryQueryFn

type PrimaryQueryFn func(conn sqlx.SqlConn, v, primary interface{}) error

type QueryFn

type QueryFn func(conn sqlx.SqlConn, v interface{}) error

Jump to

Keyboard shortcuts

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