Versions in this module Expand all Collapse all v0 v0.1.1 Jan 2, 2022 Changes in this version + var ErrConnectionWasClosed = errors.NewKind("connection was closed") + var ErrRowTimeout = errors.NewKind("row read wait bigger than connection timeout") + var ErrUnsupportedOperation = errors.NewKind("unsupported operation") + var QueryCounter = discard.NewCounter() + var QueryErrorCounter = discard.NewCounter() + var QueryHistogram = discard.NewHistogram() + func DefaultSessionBuilder(ctx context.Context, c *mysql.Conn, addr string) (sql.Session, error) + type Config struct + Address string + Auth auth.Auth + ConnReadTimeout time.Duration + ConnWriteTimeout time.Duration + DisableClientMultiStatements bool + MaxConnections uint64 + NoDefaults bool + Protocol string + RequireSecureTransport bool + TLSConfig *tls.Config + Tracer opentracing.Tracer + Version string + func (c Config) NewConfig() (Config, error) + type DoneFunc func() + type Handler struct + func NewHandler(e *sqle.Engine, sm *SessionManager, rt time.Duration, disableMultiStmts bool, ...) *Handler + func (h *Handler) ComInitDB(c *mysql.Conn, schemaName string) error + func (h *Handler) ComMultiQuery(c *mysql.Conn, query string, callback func(*sqltypes.Result, bool) error) (string, error) + func (h *Handler) ComPrepare(c *mysql.Conn, query string) ([]*query.Field, error) + func (h *Handler) ComQuery(c *mysql.Conn, query string, callback func(*sqltypes.Result, bool) error) error + func (h *Handler) ComResetConnection(c *mysql.Conn) + func (h *Handler) ComStmtExecute(c *mysql.Conn, prepare *mysql.PrepareData, ...) error + func (h *Handler) ConnectionClosed(c *mysql.Conn) + func (h *Handler) NewConnection(c *mysql.Conn) + func (h *Handler) WarningCount(c *mysql.Conn) uint16 + type Listener struct + func NewListener(protocol, address string, handler *Handler) (*Listener, error) + func (l *Listener) Accept() (net.Conn, error) + type MultiStmtMode int + const MultiStmtModeOff + const MultiStmtModeOn + type Server struct + Listener *mysql.Listener + func NewDefaultServer(cfg Config, e *sqle.Engine) (*Server, error) + func NewServer(cfg Config, e *sqle.Engine, sb SessionBuilder, listener ServerEventListener) (*Server, error) + func (s *Server) Close() error + func (s *Server) Start() error + type ServerEventListener interface + ClientConnected func() + ClientDisconnected func() + QueryCompleted func(success bool, duration time.Duration) + QueryStarted func() + type SessionBuilder func(ctx context.Context, conn *mysql.Conn, addr string) (sql.Session, error) + type SessionManager struct + func NewSessionManager(builder SessionBuilder, tracer opentracing.Tracer, ...) *SessionManager + func (s *SessionManager) CloseConn(conn *mysql.Conn) + func (s *SessionManager) NewContext(conn *mysql.Conn) (*sql.Context, error) + func (s *SessionManager) NewContextWithQuery(conn *mysql.Conn, query string) (*sql.Context, error) + func (s *SessionManager) NewSession(ctx context.Context, conn *mysql.Conn) error + func (s *SessionManager) SetDB(conn *mysql.Conn, db string) error