sql

package
v0.4.1 Latest Latest
Warning

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

Go to latest
Published: Aug 29, 2024 License: Apache-2.0 Imports: 14 Imported by: 1

Documentation

Overview

github.com/whatap/go-api/sql

github.com/whatap/go-api/sql

Index

Constants

View Source
const (
	SQL_TYPE_DBC       = 1
	SQL_TYPE_SQL       = 2
	SQL_TYPE_SQL_PARAM = 3

	SQL_PARAM_MAX_COUNT      = 20
	SQL_PARAM_VALUE_MAX_SIZE = 256
)

Variables

This section is empty.

Functions

func CloseSqlContext added in v0.2.0

func CloseSqlContext(ctx *SqlCtx)

func End

func End(sqlCtx *SqlCtx, err error) error

func Trace

func Trace(ctx context.Context, dbhost, sql string, param []interface{}, elapsed int, err error) error

Types

type SqlCtx

type SqlCtx struct {
	Txid        int64
	ServiceName string
	StartTime   int64
	Dbc         string
	Sql         string
	Param       string
	Type        uint8
	Cpu         int64
	Mem         int64
	// contains filtered or unexported fields
}

func NewSqlCtx

func NewSqlCtx() *SqlCtx

func PoolSqlContext added in v0.2.0

func PoolSqlContext() *SqlCtx

func Start

func Start(ctx context.Context, dbhost, sql string) (*SqlCtx, error)

func StartOpen

func StartOpen(ctx context.Context, dbhost string) (*SqlCtx, error)

func StartWithParam

func StartWithParam(ctx context.Context, dbhost, sql string, param ...interface{}) (*SqlCtx, error)

func StartWithParamArray

func StartWithParamArray(ctx context.Context, dbhost, sql string, param []interface{}) (*SqlCtx, error)

func (*SqlCtx) Clear added in v0.2.0

func (this *SqlCtx) Clear()

Jump to

Keyboard shortcuts

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