mysql

package
v1.2.6 Latest Latest
Warning

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

Go to latest
Published: Oct 10, 2024 License: Apache-2.0 Imports: 17 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 {
	// contains filtered or unexported fields
}

func New

func New(ctx context.Context, host, user, passwd, db string, options ...Option) (*DB, error)

func (*DB) Escape

func (t *DB) Escape(str string) string

func (*DB) MetricEnabled added in v1.2.5

func (t *DB) MetricEnabled() bool

func (*DB) Query

func (t *DB) Query(sql string, params ...interface{}) (rows []mysql.Row, res mysql.Result, err error)

func (*DB) QueryCtx

func (t *DB) QueryCtx(ctx context.Context, sql string, params ...interface{}) (rows []mysql.Row, res mysql.Result, err error)

func (*DB) QueryFirst

func (t *DB) QueryFirst(sql string, params ...interface{}) (row mysql.Row, res mysql.Result, err error)

func (*DB) QueryFirstCtx

func (t *DB) QueryFirstCtx(ctx context.Context, sql string, params ...interface{}) (row mysql.Row, res mysql.Result, err error)

func (*DB) Quote

func (t *DB) Quote(str string) string

func (*DB) TracingEnabled added in v1.2.5

func (t *DB) TracingEnabled() bool

type Option added in v1.2.5

type Option = func(opt *option)

func EnableFingerprint added in v1.2.5

func EnableFingerprint() Option

func WithMetric added in v1.2.5

func WithMetric(enabled bool) Option

func WithQueryFormator added in v1.2.5

func WithQueryFormator(queryFormatter func(query string) string) Option

func WithTracing added in v1.2.5

func WithTracing(enabled bool) Option

Jump to

Keyboard shortcuts

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