mysql

package
v0.4.0 Latest Latest
Warning

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

Go to latest
Published: Apr 7, 2023 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

View Source
const (
	SQLTimeFormatLayout = "2006-01-02 15:04:05"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type MySQLConfig

type MySQLConfig struct {
	Host             string
	Port             int
	UserName         string
	Password         string
	DBName           string
	Collation        string // e.g. utf8_general_ci
	MaxAllowedPacket int    // in byts
	Location         *time.Location
	ConnectTimeout   time.Duration
	ReadTimeout      time.Duration
	WriteTimeout     time.Duration
	MaxIdleConns     int
	MaxOpenConns     int
	ConnMaxLifetime  time.Duration
}

type MysqlConnector added in v0.0.3

type MysqlConnector struct {
	// contains filtered or unexported fields
}

func NewMockedMySQLConnector added in v0.1.4

func NewMockedMySQLConnector(conn *sql.DB) *MysqlConnector

return MysqlConnector with setting client to given connection its expected to provide mocked conn while calling this api

func NewMySQLConnector

func NewMySQLConnector(cfg MySQLConfig) (*MysqlConnector, error)

return the new MySQL connector

func (*MysqlConnector) CheckTableUpdatedSince added in v0.3.4

func (conn *MysqlConnector) CheckTableUpdatedSince(database string, tables []string, time time.Time) (updated bool, err error)

to use this function ensure that mysql connection user have select privileges on INFORMATION_SCHEMA.PARTITIONS retrun true if data is updated in the table

func (*MysqlConnector) Close added in v0.0.3

func (conn *MysqlConnector) Close()

close the Aerospike client connection

func (*MysqlConnector) Execute added in v0.0.3

func (conn *MysqlConnector) Execute(query string, args ...any) (sql.Result, error)

func (*MysqlConnector) ExecuteSelect added in v0.0.3

func (conn *MysqlConnector) ExecuteSelect(query string, args ...any) (*sql.Rows, error)

execute the select queries

Jump to

Keyboard shortcuts

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