mysql

package
v0.0.0-...-6af97ad Latest Latest
Warning

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

Go to latest
Published: Dec 21, 2018 License: Apache-2.0 Imports: 4 Imported by: 2

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Mysql

type Mysql struct {
	Config MysqlConfig
	Client *sql.DB
}

a client

func New

func New(config MysqlConfig) *Mysql

func (*Mysql) Create

func (db *Mysql) Create(prestring string, parm ...interface{}) (int64, error)

建表 Create table

func (*Mysql) Drop

func (db *Mysql) Drop(prestring string, parm ...interface{}) (int64, error)

删表

func (*Mysql) Insert

func (db *Mysql) Insert(prestring string, parm ...interface{}) (int64, error)

插入数据 Insert Data

func (*Mysql) Open

func (db *Mysql) Open(maxopen int, maxidle int)

打开数据库连接 open a connecttion

func (*Mysql) Select

func (db *Mysql) Select(prestring string, parm ...interface{}) (returnrows []map[string]interface{}, err error)

查询数据库 Query

type MysqlConfig

type MysqlConfig struct {
	Username string
	Password string
	Ip       string
	Port     string
	Dbname   string
}

Mysql config

func (MysqlConfig) CreateDb

func (dbconfig MysqlConfig) CreateDb() error

create database

func (MysqlConfig) DeleteDb

func (dbconfig MysqlConfig) DeleteDb() error

Jump to

Keyboard shortcuts

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