Versions in this module Expand all Collapse all v0 v0.2.0 Sep 30, 2023 Changes in this version + const UserMaxAllowedPacket + func AppendDateTime(buf []byte, t time.Time) ([]byte, error) + func DeregisterServerPubKey(name string) + func DeregisterTLSConfig(key string) + func Escape(sql string) string + func GetDefaultFieldLengthAndDecimal(tp mysql.FieldType) (flen int, decimal int) + func GetDefaultFieldLengthAndDecimalForCast(tp mysql.FieldType) (flen int, decimal int) + func IsIntegerType(tp mysql.FieldType) bool + func NewListener(conf *config.Listener) (proto.Listener, error) + func ParseErrorPacket(data []byte) error + func PutLengthEncodedInt(n uint64) []byte + func PutLengthEncodedString(b []byte) []byte + func RandomBuf(size int) ([]byte, error) + func RegisterServerPubKey(name string, pubKey *rsa.PublicKey) + func RegisterTLSConfig(key string, config *tls.Config) error + type BackendConnection struct + func (conn *BackendConnection) Close() + func (conn *BackendConnection) Connect(ctx context.Context) error + func (conn *BackendConnection) DBName() string + func (conn *BackendConnection) DrainResults() error + func (conn *BackendConnection) ExecuteWithWarningCount(query string, wantFields bool) (result proto.Result, err error) + func (conn *BackendConnection) ExecuteWithWarningCountIterRow(query string) (result proto.Result, err error) + func (conn *BackendConnection) GetDatabaseConn() *Conn + func (conn *BackendConnection) PersistVariables() (map[string]proto.Value, error) + func (conn *BackendConnection) Ping() error + func (conn *BackendConnection) PrepareExecute(query string, data []byte) (proto.Result, error) + func (conn *BackendConnection) PrepareExecuteArgs(query string, args []proto.Value) (proto.Result, error) + func (conn *BackendConnection) PrepareQuery(query string, data []byte) (proto.Result, error) + func (conn *BackendConnection) PrepareQueryArgs(query string, data []proto.Value) (proto.Result, error) + func (conn *BackendConnection) ReadColumnDefinition(field *Field, index int) error + func (conn *BackendConnection) ReadColumnDefinitionType(field *Field, index int) error + func (conn *BackendConnection) ReadColumnDefinitions() ([]proto.Field, error) + func (conn *BackendConnection) ReadQueryResult(wantFields bool) proto.Result + func (conn *BackendConnection) ReadQueryRow() *RawResult + func (conn *BackendConnection) ResetVariables() error + func (conn *BackendConnection) SyncVariables(vars map[string]proto.Value) error + func (conn *BackendConnection) WriteComFieldList(table string, wildcard string) error + func (conn *BackendConnection) WriteComInitDB(db string) error + func (conn *BackendConnection) WriteComQuery(query string) error + func (conn *BackendConnection) WriteComSetOption(operation uint16) error + type BackendStatement struct + type BinaryRow struct + func NewBinaryRow(fields []proto.Field, raw []byte) BinaryRow + func (bi BinaryRow) Fields() []proto.Field + func (bi BinaryRow) Get(name string) (proto.Value, error) + func (bi BinaryRow) IsBinary() bool + func (bi BinaryRow) Length() int + func (bi BinaryRow) Scan(dest []proto.Value) error + func (bi BinaryRow) WriteTo(w io.Writer) (n int64, err error) + type Config struct + Addr string + AllowAllFiles bool + AllowCleartextPasswords bool + AllowNativePasswords bool + AllowOldPasswords bool + CheckConnLiveness bool + ClientFoundRows bool + Collation string + ColumnsWithAlias bool + DBName string + DisableClientDeprecateEOF bool + InterpolateParams bool + Loc *time.Location + MaxAllowedPacket int + MultiStatements bool + Net string + Params map[string]string + ParseTime bool + Passwd string + ReadTimeout time.Duration + RejectReadOnly bool + ServerPubKey string + TLSConfig string + Timeout time.Duration + User string + WriteTimeout time.Duration + func NewConfig() *Config + func ParseDSN(dsn string) (cfg *Config, err error) + func (cfg *Config) Clone() *Config + type Conn struct + Capabilities uint32 + StatusFlags uint16 + func (c *Conn) CharacterSet() uint8 + func (c *Conn) Close() + func (c *Conn) DefColumnDefinition(field *Field) []byte + func (c *Conn) GetNetConn() net.Conn + func (c *Conn) GetTLSClientCerts() []*x509.Certificate + func (c *Conn) ID() uint32 + func (c *Conn) IsClosed() bool + func (c *Conn) ReadPacket() ([]byte, error) + func (c *Conn) RemoteAddr() net.Addr + func (c *Conn) Schema() string + func (c *Conn) ServerVersion() string + func (c *Conn) SetSchema(schema string) + func (c *Conn) SetTenant(t string) + func (c *Conn) SetTransientVariables(v map[string]proto.Value) + func (c *Conn) String() string + func (c *Conn) Tenant() string + func (c *Conn) TransientVariables() map[string]proto.Value + type Connector struct + func NewConnector(dsn string) (*Connector, error) + func (c *Connector) NewBackendConnection(ctx context.Context) (*BackendConnection, error) + type Field struct + func NewField(name string, filedType mysql.FieldType) *Field + func (mf *Field) DatabaseName() string + func (mf *Field) DatabaseTypeName() string + func (mf *Field) DecimalSize() (int64, int64, bool) + func (mf *Field) FieldType() mysql.FieldType + func (mf *Field) Length() (length int64, ok bool) + func (mf *Field) Name() string + func (mf *Field) Nullable() (nullable, ok bool) + func (mf *Field) OriginName() string + func (mf *Field) ScanType() reflect.Type + func (mf *Field) SetName(name string) + func (mf *Field) SetOrgName(name string) + func (mf *Field) TableName() string + type Listener struct + func (l *Listener) Close() + func (l *Listener) ExecuteCommand(c *Conn, ctx *proto.Context) error + func (l *Listener) Listen() + func (l *Listener) SetExecutor(executor proto.Executor) + func (l *Listener) ValidateHash(handshake *handshakeResult) error + type RawBytes []byte + type RawResult struct + func (rr *RawResult) Close() error + func (rr *RawResult) Dataset() (proto.Dataset, error) + func (rr *RawResult) Discard() (err error) + func (rr *RawResult) Fields() ([]proto.Field, error) + func (rr *RawResult) LastInsertId() (uint64, error) + func (rr *RawResult) Next() (row proto.Row, err error) + func (rr *RawResult) RowsAffected() (uint64, error) + func (rr *RawResult) SetCloser(closer func() error) + func (rr *RawResult) Warn() (uint16, error) + type Scanner interface + Scan func(src interface{}) error + type ServerConfig struct + ServerVersion string + type TextRow struct + func NewTextRow(fields []proto.Field, raw []byte) TextRow + func (te TextRow) Fields() []proto.Field + func (te TextRow) Get(name string) (proto.Value, error) + func (te TextRow) IsBinary() bool + func (te TextRow) Length() int + func (te TextRow) Scan(dest []proto.Value) error + func (te TextRow) WriteTo(w io.Writer) (n int64, err error) v0.1.0-rc1 Sep 1, 2022