mysql

package
v0.0.0-...-2ae4540 Latest Latest
Warning

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

Go to latest
Published: Jan 17, 2018 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type MySQLCli

type MySQLCli struct {
	*sql.DB
}

func (*MySQLCli) Delete

func (mc *MySQLCli) Delete(deleteSQL string, args ...interface{}) (sql.Result, error)

删除

func (*MySQLCli) Insert

func (mc *MySQLCli) Insert(insertSQL string, args ...interface{}) (sql.Result, error)

新增

func (*MySQLCli) Query

func (mc *MySQLCli) Query(selectSQL string, args ...interface{}) (*sql.Row, error)

TODO 查询,不使用事务

func (*MySQLCli) Update

func (mc *MySQLCli) Update(updateSQL string, args ...interface{}) (sql.Result, error)

更新

type MySQLConfig

type MySQLConfig struct {
	Rawurl          string        `json:"rawurl"`
	MaxOpenConns    int           `json:"max_open_conns"`
	MaxIdleConns    int           `json:"max_idle_conns"`
	ConnMaxLifetime time.Duration `json:"conn_max_lifetime"`
}

func (*MySQLConfig) NewConnection

func (mc *MySQLConfig) NewConnection() (mysqlCli MySQLCli, err error)

新建一个mysql连接,返回连接

Jump to

Keyboard shortcuts

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