golden

package
v0.18.1 Latest Latest
Warning

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

Go to latest
Published: Apr 9, 2024 License: Apache-2.0 Imports: 19 Imported by: 0

Documentation

Index

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 mysql.ResultSpoolFn,
) (string, error)

ComMultiQuery implements mysql.Handler.

func (MySqlProxy) ComParsedQuery added in v0.18.0

func (h MySqlProxy) ComParsedQuery(
	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(_ *mysql.Conn, _ string, _ *mysql.PrepareData) ([]*querypb.Field, error)

ComPrepare implements mysql.Handler.

func (MySqlProxy) ComQuery

func (h MySqlProxy) ComQuery(
	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(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) ComInitDB

func (v Validator) ComInitDB(c *mysql.Conn, schemaName string) error

func (Validator) ComMultiQuery

func (v Validator) ComMultiQuery(
	c *mysql.Conn,
	query string,
	callback mysql.ResultSpoolFn,
) (string, error)

func (Validator) ComParsedQuery added in v0.18.0

func (v Validator) ComParsedQuery(
	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(_ *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(
	c *mysql.Conn,
	query string,
	callback mysql.ResultSpoolFn,
) error

ComQuery executes a SQL query on the SQLe engine.

func (Validator) ComResetConnection

func (v Validator) ComResetConnection(_ *mysql.Conn) error

func (Validator) ComStmtExecute

func (v Validator) ComStmtExecute(c *mysql.Conn, prepare *mysql.PrepareData, callback func(*sqltypes.Result) error) error

func (Validator) ConnectionClosed

func (v Validator) ConnectionClosed(c *mysql.Conn)

ConnectionClosed reports that a connection has been closed.

func (Validator) NewConnection

func (v Validator) NewConnection(c *mysql.Conn)

NewConnection reports that a new connection has been established.

func (Validator) ParserOptionsForConnection added in v0.17.0

func (v Validator) ParserOptionsForConnection(_ *mysql.Conn) (sqlparser.ParserOptions, error)

func (Validator) WarningCount

func (v Validator) 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.

Jump to

Keyboard shortcuts

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