mysql

package
v0.4.13 Latest Latest
Warning

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

Go to latest
Published: Apr 6, 2024 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

View Source
const (
	Driver drivers.DBDriver = "mysql"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Connection

type Connection struct {
	Driver      drivers.DBDriver       `json:"driver"`
	Host        string                 `json:"host"`
	Port        int                    `json:"port"`
	Database    string                 `json:"database"`
	Username    string                 `json:"username"`
	Password    string                 `json:"password"`
	Charset     string                 `json:"charset"`
	Collation   string                 `json:"collation"`
	Prefix      string                 `json:"prefix"`
	ParseTime   bool                   `json:"parse_time"`
	Location    string                 `json:"location"`
	Debug       bool                   `json:"debug"`
	Pool        *ConnectionPool        `json:"pool"`
	HealthCheck *ConnectionHealthCheck `json:"health_check"`
}

func (*Connection) GetDriver

func (i *Connection) GetDriver() drivers.DBDriver

func (*Connection) IsDebug

func (i *Connection) IsDebug() bool

func (*Connection) NewConnector

func (i *Connection) NewConnector(name string) (drivers.ConnectorInterface, error)

type ConnectionHealthCheck

type ConnectionHealthCheck struct {
	TableName string `json:"table_name"`
	Key       string `json:"key"`
}

type ConnectionPool

type ConnectionPool struct {
	MaxIdleConnections int `json:"max_idle_connections"`
	MaxConnections     int `json:"max_connections"`
	ConnectTimeout     int `json:"connect_timeout"`
	MaxIdleTime        int `json:"max_idle_time"`
}

type MysqlConnector

type MysqlConnector struct {
	drivers.GormQuery
	// contains filtered or unexported fields
}

func NewMysqlConnector

func NewMysqlConnector(connection string, config *Connection) (*MysqlConnector, error)

func (*MysqlConnector) Connect

func (i *MysqlConnector) Connect() error

func (*MysqlConnector) GetConnection

func (i *MysqlConnector) GetConnection() string

func (*MysqlConnector) GetDB

func (i *MysqlConnector) GetDB() any

func (*MysqlConnector) GetDriver

func (i *MysqlConnector) GetDriver() drivers.DriverInterface

Jump to

Keyboard shortcuts

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