mysql

package
v1.2.15 Latest Latest
Warning

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

Go to latest
Published: Apr 8, 2024 License: MIT Imports: 16 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ExecTxQuery

func ExecTxQuery(query string, tx *sql.Tx, args ...interface{}) (string, error)

ExecTxQuery - ExecTxQuery

func GetMYSQLConnection

func GetMYSQLConnection(connectionName string) (*dbr.Connection, error)

GetMYSQLConnection -

func Init

func Init(tomlFilepath string, defaultHostName string) (map[string]*dbr.Connection, error)

Init initializes MYSQL Connections for given toml file

func InitConnection

func InitConnection(connectionDetails MySQLConnection) (*dbr.Connection, error)

InitConnection - InitConnection

func InitUsingJSON

func InitUsingJSON(configs []MySQLConnection) error

InitUsingJSON - InitUsingJSON

func SelectTxQuery

func SelectTxQuery(query string, tx *sql.Tx, args ...interface{}) (*gjson.Result, error)

SelectTxQuery - SelectTxQuery

Types

type MySQLConnection

type MySQLConnection struct {
	HostName        string        `json:"hostName" bson:"hostName"`
	Server          string        `json:"server" bson:"server"`
	Port            int           `json:"port" bson:"port"`
	Username        string        `json:"username" bson:"username"`
	Password        string        `json:"password" bson:"password"`
	Protocol        string        `json:"protocol" bson:"protocol"`
	Database        string        `json:"database" bson:"database"`
	Parameters      []param       `json:"params" bson:"params"`
	MaxIdleConns    int           `json:"maxIdleConns" bson:"maxIdleConns"`
	MaxOpenConns    int           `json:"maxOpenConns" bson:"maxOpenConns"`
	ConnMaxLifetime time.Duration `json:"connMaxLifetime" bson:"connMaxLifetime"`
	IsDefault       bool          `json:"isDefault" bson:"isDefault"`
	IsDisabled      bool          `json:"isDisabled" bson:"isDisabled"`
}

MySQLConnection - MySQLConnection

type MySQLDAO

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

MysqlDAO Mysql DAO struct

func GetMySQLDAO

func GetMySQLDAO() *MySQLDAO

GetMysqlDAO return Mysql DAO instance

func GetMySQLDAOWithHost

func GetMySQLDAOWithHost(host string) *MySQLDAO

GetMysqlDAOWithHost return Mysql DAO instance

func (*MySQLDAO) ExecQuery

func (md *MySQLDAO) ExecQuery(query string, args ...interface{}) (string, error)

ExecQuery - ExecQuery

func (*MySQLDAO) SelectQuery

func (md *MySQLDAO) SelectQuery(query string, args ...interface{}) (*gjson.Result, error)

SelectQuery - SelectQuery

Jump to

Keyboard shortcuts

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