mysql

package
v1.0.0-alpha Latest Latest
Warning

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

Go to latest
Published: May 10, 2025 License: MIT, MIT Imports: 17 Imported by: 0

Documentation

Index

Constants

View Source
const (
	GetConnRetry = 3
)

Variables

View Source
var DMLSQL = []string{
	"BEGIN",
	"BEGIN TRANSACTION",
	"COMMIT",
	"END TRANSACTION",
	"ROLLBACK",
	"INSERT",
	"UPDATE",
	"DELETE",
	"CREATE",
	"ALERT",
	"DROP",
}

Functions

func NewMySQLProxy

func NewMySQLProxy(ctx context.Context, server *server.Server, credential server.CredentialProvider) *mysqlProxy

func Run

func Run(ctx context.Context) (err error)

Types

type Handle

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

func (*Handle) CloseConn

func (h *Handle) CloseConn(c *server.Conn) error

func (*Handle) HandleFieldList

func (h *Handle) HandleFieldList(c *server.Conn, table string, fieldWildcard string) ([]*mysql.Field, error)

func (*Handle) HandleOtherCommand

func (h *Handle) HandleOtherCommand(c *server.Conn, cmd byte, data []byte) error

sq

func (*Handle) HandleQuery

func (h *Handle) HandleQuery(c *server.Conn, query string) (res *mysql.Result, err error)

func (*Handle) HandleStmtClose

func (h *Handle) HandleStmtClose(c *server.Conn, context interface{}) error

func (*Handle) HandleStmtExecute

func (h *Handle) HandleStmtExecute(c *server.Conn, context interface{}, query string, args []interface{}) (*mysql.Result, error)

func (*Handle) HandleStmtPrepare

func (h *Handle) HandleStmtPrepare(c *server.Conn, query string) (int, int, interface{}, error)

func (*Handle) UseDB

func (h *Handle) UseDB(c *server.Conn, dbName string) error

Jump to

Keyboard shortcuts

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