xmysql

package
v1.0.14 Latest Latest
Warning

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

Go to latest
Published: Aug 24, 2023 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func FlushHandlers

func FlushHandlers()

func KeepHandler

func KeepHandler(name string, newHandler *Handler)

KeepHandler 연결을 보관하고자 할 때

Types

type CommitCallback

type CommitCallback func()

type ErrorCallback

type ErrorCallback func(error)

type ExecCallback

type ExecCallback func(int64, int64)

type Handler

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

func GetHandler

func GetHandler(name string) *Handler

func NewHandler

func NewHandler(server, uid, pwd, source string, port, io int) (*Handler, error)

NewHandler 새연결

func (*Handler) Execute

func (s *Handler) Execute(queryString string, execCallback ExecCallback, errCallback ErrorCallback)

func (*Handler) Query

func (s *Handler) Query(executor *QueryExecutor)

Query 단일 쿼리 호출

func (*Handler) SyncQuery

func (s *Handler) SyncQuery(sqlString string) (*RecordSet, error)

func (*Handler) Transaction

func (s *Handler) Transaction(onCommit CommitCallback, onRollback RollbackCallback, queries ...*QueryExecutor)

Transaction 트랜잭션을 위한 쿼리 호출 (주의: procedure 를 사용할 경우 procedure 내에서 transaction 처리를 하면 안됨)

type QueryCallback

type QueryCallback func(*RecordSet) error

type QueryExecutor

type QueryExecutor struct {
	SqlString string
	OnQuery   QueryCallback
	OnError   ErrorCallback
}

type RecordSet

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

func (*RecordSet) Close

func (rs *RecordSet) Close()

func (*RecordSet) NextResultSet

func (rs *RecordSet) NextResultSet() bool

func (*RecordSet) NextRow

func (rs *RecordSet) NextRow() bool

func (*RecordSet) Scan

func (rs *RecordSet) Scan(fields ...any) error

type RollbackCallback

type RollbackCallback func(error)

Jump to

Keyboard shortcuts

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