Documentation
¶
Index ¶
- type MySqlProxy
- func (h MySqlProxy) ComInitDB(c *mysql.Conn, schemaName string) error
- func (h MySqlProxy) ComMultiQuery(ctx context.Context, c *mysql.Conn, query string, callback mysql.ResultSpoolFn) (string, error)
- func (h MySqlProxy) ComParsedQuery(ctx context.Context, c *mysql.Conn, query string, parsed sqlparser.Statement, ...) error
- func (h MySqlProxy) ComPrepare(ctx context.Context, _ *mysql.Conn, _ string, _ *mysql.PrepareData) ([]*querypb.Field, error)
- func (h MySqlProxy) ComQuery(ctx context.Context, c *mysql.Conn, query string, callback mysql.ResultSpoolFn) error
- func (h MySqlProxy) ComResetConnection(_ *mysql.Conn) error
- func (h MySqlProxy) ComStmtExecute(ctx context.Context, c *mysql.Conn, prepare *mysql.PrepareData, ...) error
- func (h MySqlProxy) ConnectionAborted(c *mysql.Conn, reason string) 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(ctx context.Context, c *mysql.Conn, query string, callback mysql.ResultSpoolFn) (string, error)
- func (v Validator) ComParsedQuery(ctx context.Context, c *mysql.Conn, query string, parsed sqlparser.Statement, ...) error
- func (v Validator) ComPrepare(_ context.Context, _ *mysql.Conn, _ string, _ *mysql.PrepareData) ([]*query.Field, error)
- func (v Validator) ComQuery(ctx context.Context, c *mysql.Conn, query string, callback mysql.ResultSpoolFn) error
- func (v Validator) ComResetConnection(_ *mysql.Conn) error
- func (v Validator) ComStmtExecute(ctx context.Context, c *mysql.Conn, prepare *mysql.PrepareData, ...) error
- func (v Validator) ConnectionAborted(c *mysql.Conn, reason string) 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( ctx context.Context, c *mysql.Conn, query string, callback mysql.ResultSpoolFn, ) (string, error)
ComMultiQuery implements mysql.Handler.
func (MySqlProxy) ComParsedQuery ¶ added in v0.18.0
func (h MySqlProxy) ComParsedQuery( ctx context.Context, c *mysql.Conn, query string, parsed sqlparser.Statement, callback func(*sqltypes.Result, bool) error, ) error
ComParsedQuery implements mysql.Handler.
func (MySqlProxy) ComPrepare ¶
func (h MySqlProxy) ComPrepare(ctx context.Context, _ *mysql.Conn, _ string, _ *mysql.PrepareData) ([]*querypb.Field, error)
ComPrepare implements mysql.Handler.
func (MySqlProxy) ComQuery ¶
func (h MySqlProxy) ComQuery( ctx context.Context, c *mysql.Conn, query string, callback mysql.ResultSpoolFn, ) error
ComQuery implements mysql.Handler.
func (MySqlProxy) ComResetConnection ¶
func (h MySqlProxy) ComResetConnection(_ *mysql.Conn) error
ComResetConnection implements mysql.Handler.
func (MySqlProxy) ComStmtExecute ¶
func (h MySqlProxy) ComStmtExecute(ctx context.Context, c *mysql.Conn, prepare *mysql.PrepareData, callback func(*sqltypes.Result) error) error
ComStmtExecute implements mysql.Handler.
func (MySqlProxy) ConnectionAborted ¶ added in v0.19.0
func (h MySqlProxy) ConnectionAborted(c *mysql.Conn, reason string) error
ConnectionAborted 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) ComParsedQuery ¶ added in v0.18.0
func (v Validator) ComParsedQuery( ctx context.Context, c *mysql.Conn, query string, parsed sqlparser.Statement, callback func(*sqltypes.Result, bool) error, ) error
ComQuery executes a SQL query on the SQLe engine.
func (Validator) ComPrepare ¶
func (v Validator) ComPrepare(_ context.Context, _ *mysql.Conn, _ string, _ *mysql.PrepareData) ([]*query.Field, error)
ComPrepare parses, partially analyzes, and caches a prepared statement's plan with the given [c.ConnectionID].
func (Validator) ComQuery ¶
func (v Validator) ComQuery( ctx context.Context, c *mysql.Conn, query string, callback mysql.ResultSpoolFn, ) error
ComQuery executes a SQL query on the SQLe engine.
func (Validator) ComStmtExecute ¶
func (Validator) ConnectionAborted ¶ added in v0.19.0
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.