mysql

package
v0.12.0 Latest Latest
Warning

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

Go to latest
Published: May 3, 2026 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 Config

type Config struct {
	Port                  int
	User                  string
	Pass                  string
	ConnectorProvider     ConnectorProvider
	DBProvider            DBProvider
	CreateDatabaseOptions sqlite.LoadConfig
}

type ConnectorProvider added in v0.10.1

type ConnectorProvider func(dbName string) (*ha.Connector, bool)

type DBProvider

type DBProvider func(dbName string) (*sql.DB, bool)

type Handler

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

func (*Handler) HandleFieldList

func (h *Handler) HandleFieldList(table string, fieldWildcard string) ([]*mysql.Field, error)

HandleFieldList is called for COM_FIELD_LIST packets Note that COM_FIELD_LIST has been deprecated since MySQL 5.7.11 https://dev.mysql.com/doc/dev/mysql-server/latest/page_protocol_com_field_list.html

func (*Handler) HandleOtherCommand

func (h *Handler) HandleOtherCommand(cmd byte, data []byte) error

func (*Handler) HandleQuery

func (h *Handler) HandleQuery(query string) (*mysql.Result, error)

func (*Handler) HandleStmtClose

func (h *Handler) HandleStmtClose(context any) error

func (*Handler) HandleStmtExecute

func (h *Handler) HandleStmtExecute(context any, query string, args []any) (*mysql.Result, error)

func (*Handler) HandleStmtPrepare

func (h *Handler) HandleStmtPrepare(query string) (int, int, any, error)

func (*Handler) UseDB

func (h *Handler) UseDB(dbName string) error

type Server

type Server struct {
	ConnectorProvider ConnectorProvider
	DBProvider        DBProvider
	Port              int
	User              string
	Pass              string
	// contains filtered or unexported fields
}

func NewServer

func NewServer(cfg Config) (*Server, error)

func (*Server) Close

func (s *Server) Close() error

func (*Server) ListenAndServe

func (s *Server) ListenAndServe() error

Jump to

Keyboard shortcuts

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