gokit

package
v0.0.0-...-15846b5 Latest Latest
Warning

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

Go to latest
Published: Jun 20, 2020 License: MIT Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type DB

type DB struct {
	Dsn    string // dsn
	Prefix string // 前缀
}

func (*DB) Count

func (d *DB) Count(tanleName string, cond string) (int64, error)

获取条数

func (*DB) Delete

func (d *DB) Delete(tanleName string, cond string) error

删除数据

func (*DB) GetDb

func (d *DB) GetDb() (*gorose.Connection, error)

数据库 dsn "账号:密码@tcp(IP:端口)/数据库?charset=utf8" prefix 前缀

func (*DB) Insert

func (d *DB) Insert(tanleName string, data interface{}) error

新增数据

func (*DB) SelectAll

func (d *DB) SelectAll(tanleName string, fields []string, cond string, order string, limit, offset int) ([]map[string]interface{}, error)

分页查询数据

func (*DB) SelectRow

func (d *DB) SelectRow(tanleName string, fields []string, cond, order string) (map[string]interface{}, error)

查询一条数据

func (*DB) SelectRows

func (d *DB) SelectRows(tanleName string, fields []string, cond string, order string) ([]map[string]interface{}, error)

查询多条数据

func (*DB) Update

func (d *DB) Update(tanleName string, set map[string]interface{}, cond string) error

更新数据

Jump to

Keyboard shortcuts

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