mysql

package
v0.8.3 Latest Latest
Warning

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

Go to latest
Published: Feb 1, 2026 License: Apache-2.0 Imports: 14 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
	DBProvider            DBProvider
	CreateDatabaseOptions CreateDatabaseOptions
}

type CreateDatabaseOptions added in v0.6.3

type CreateDatabaseOptions struct {
	Dir                string
	MemDB              bool
	FromLatestSnapshot bool
	DeliverPolicy      string
	MaxConns           int
	Opts               []ha.Option
}

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 {
	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