Documentation ¶
Index ¶
- type MySqlProxy
- func (h MySqlProxy) ComInitDB(c *mysql.Conn, schemaName string) error
- func (h MySqlProxy) ComMultiQuery(c *mysql.Conn, query string, callback func(*sqltypes.Result, bool) error) (string, error)
- func (h MySqlProxy) ComPrepare(c *mysql.Conn, query string) ([]*querypb.Field, error)
- func (h MySqlProxy) ComQuery(c *mysql.Conn, query string, callback func(*sqltypes.Result, bool) error) error
- func (h MySqlProxy) ComResetConnection(c *mysql.Conn)
- func (h MySqlProxy) ComStmtExecute(c *mysql.Conn, prepare *mysql.PrepareData, ...) error
- func (h MySqlProxy) ConnectionClosed(c *mysql.Conn)
- func (h MySqlProxy) NewConnection(c *mysql.Conn)
- func (h MySqlProxy) ParserOptionsForConnection(_ *mysql.Conn) (sqlparser.ParserOptions, error)
- func (h MySqlProxy) WarningCount(c *mysql.Conn) uint16
- type Validator
- func (v Validator) ComInitDB(c *mysql.Conn, schemaName string) error
- func (v Validator) ComMultiQuery(c *mysql.Conn, query string, callback func(*sqltypes.Result, bool) error) (string, error)
- func (v Validator) ComPrepare(c *mysql.Conn, query string) ([]*query.Field, error)
- func (v Validator) ComQuery(c *mysql.Conn, query string, callback func(*sqltypes.Result, bool) error) error
- func (v Validator) ComResetConnection(c *mysql.Conn)
- func (v Validator) ComStmtExecute(c *mysql.Conn, prepare *mysql.PrepareData, ...) error
- func (v Validator) ConnectionClosed(c *mysql.Conn)
- func (v Validator) NewConnection(c *mysql.Conn)
- func (v Validator) ParserOptionsForConnection(_ *mysql.Conn) (sqlparser.ParserOptions, error)
- func (v Validator) WarningCount(c *mysql.Conn) uint16
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type MySqlProxy ¶
type MySqlProxy struct {
// contains filtered or unexported fields
}
func NewMySqlProxyHandler ¶
func NewMySqlProxyHandler(logger *logrus.Logger, connStr string) (MySqlProxy, error)
NewMySqlProxyHandler creates a new MySqlProxy.
func (MySqlProxy) ComInitDB ¶
func (h MySqlProxy) ComInitDB(c *mysql.Conn, schemaName string) error
ComInitDB implements mysql.Handler.
func (MySqlProxy) ComMultiQuery ¶
func (h MySqlProxy) ComMultiQuery( c *mysql.Conn, query string, callback func(*sqltypes.Result, bool) error, ) (string, error)
ComMultiQuery implements mysql.Handler.
func (MySqlProxy) ComPrepare ¶
ComPrepare implements mysql.Handler.
func (MySqlProxy) ComQuery ¶
func (h MySqlProxy) ComQuery( c *mysql.Conn, query string, callback func(*sqltypes.Result, bool) error, ) error
ComQuery implements mysql.Handler.
func (MySqlProxy) ComResetConnection ¶
func (h MySqlProxy) ComResetConnection(c *mysql.Conn)
ComResetConnection implements mysql.Handler.
func (MySqlProxy) ComStmtExecute ¶
func (h MySqlProxy) ComStmtExecute(c *mysql.Conn, prepare *mysql.PrepareData, callback func(*sqltypes.Result) error) error
ComStmtExecute implements mysql.Handler.
func (MySqlProxy) ConnectionClosed ¶
func (h MySqlProxy) ConnectionClosed(c *mysql.Conn)
ConnectionClosed implements mysql.Handler.
func (MySqlProxy) NewConnection ¶
func (h MySqlProxy) NewConnection(c *mysql.Conn)
NewConnection implements mysql.Handler.
func (MySqlProxy) ParserOptionsForConnection ¶ added in v0.17.0
func (h MySqlProxy) ParserOptionsForConnection(_ *mysql.Conn) (sqlparser.ParserOptions, error)
func (MySqlProxy) WarningCount ¶
func (h MySqlProxy) WarningCount(c *mysql.Conn) uint16
WarningCount is called at the end of each query to obtain the value to be returned to the client in the EOF packet. Note that this will be called either in the context of the ComQuery resultsCB if the result does not contain any fields, or after the last ComQuery call completes.
type Validator ¶
type Validator struct {
// contains filtered or unexported fields
}
func NewValidatingHandler ¶
func NewValidatingHandler(handler mysql.Handler, mySqlConn string, logger *logrus.Logger) (Validator, error)
NewValidatingHandler creates a new Validator wrapping a MySQL connection.
func (Validator) ComMultiQuery ¶
func (Validator) ComPrepare ¶
ComPrepare parses, partially analyzes, and caches a prepared statement's plan with the given [c.ConnectionID].
func (Validator) ComQuery ¶
func (v Validator) ComQuery( c *mysql.Conn, query string, callback func(*sqltypes.Result, bool) error, ) error
ComQuery executes a SQL query on the SQLe engine.
func (Validator) ComResetConnection ¶
func (Validator) ComStmtExecute ¶
func (Validator) ConnectionClosed ¶
ConnectionClosed reports that a connection has been closed.
func (Validator) NewConnection ¶
NewConnection reports that a new connection has been established.
func (Validator) ParserOptionsForConnection ¶ added in v0.17.0
func (Validator) WarningCount ¶
WarningCount is called at the end of each query to obtain the value to be returned to the client in the EOF packet. Note that this will be called either in the context of the ComQuery resultsCB if the result does not contain any fields, or after the last ComQuery call completes.