mysql

package
v0.0.0-...-4498091 Latest Latest
Warning

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

Go to latest
Published: Dec 8, 2017 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DB

func DB() (*sql.DB, error)

func Refresh

func Refresh()

Types

type MyTable

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

*********************** Mysql 输出 ************************** sql转换结构体

func New

func New() *MyTable

func (*MyTable) AddColumn

func (self *MyTable) AddColumn(names ...string) *MyTable

设置表单列

func (*MyTable) AutoInsert

func (self *MyTable) AutoInsert(value []string) *MyTable

智能插入数据,每次1行

func (*MyTable) Clone

func (m *MyTable) Clone() *MyTable

func (*MyTable) Create

func (self *MyTable) Create() error

生成"创建表单"的语句,执行前须保证SetTableName()、AddColumn()已经执行

func (*MyTable) CustomPrimaryKey

func (self *MyTable) CustomPrimaryKey(primaryKeyCode string) *MyTable

设置主键的语句(可选)

func (*MyTable) FlushInsert

func (self *MyTable) FlushInsert() error

向sqlCode添加"插入数据"的语句,执行前须保证Create()、AutoInsert()已经执行

func (*MyTable) SelectAll

func (self *MyTable) SelectAll() (*sql.Rows, error)

获取全部数据

func (*MyTable) SetTableName

func (self *MyTable) SetTableName(name string) *MyTable

设置表名

func (*MyTable) Truncate

func (self *MyTable) Truncate() error

清空表单,执行前须保证SetTableName()已经执行

Jump to

Keyboard shortcuts

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