ORM

package module
v0.0.0-...-058c169 Latest Latest
Warning

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

Go to latest
Published: Sep 12, 2019 License: Apache-2.0 Imports: 6 Imported by: 0

README

ORM

go语言实现简单Mysql操作 依赖于:github.com/go-sql-driver/mysql

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type MysqlDBConfig

type MysqlDBConfig struct {
	// contains filtered or unexported fields
}
var DBConfig *MysqlDBConfig

func (*MysqlDBConfig) Alias

func (DBConfig *MysqlDBConfig) Alias(str string) *MysqlDBConfig

* 设置数据表

func (*MysqlDBConfig) Delete

func (DBConfig *MysqlDBConfig) Delete(isRows bool) (rows int64, err error)

* 删除数据 isRows true 返回影响的行数 FALSE 返回最后一行的主键ID

func (*MysqlDBConfig) Field

func (DBConfig *MysqlDBConfig) Field(str string) *MysqlDBConfig

* 设置查询字段,支持链式,支持重复调用

func (*MysqlDBConfig) Find

func (DBConfig *MysqlDBConfig) Find() (result map[string]string, err error)

* 指查询一条

func (*MysqlDBConfig) GroupBy

func (DBConfig *MysqlDBConfig) GroupBy(str string, mode string) *MysqlDBConfig

* 设置分组排序,支持链式调用,不支持重复使用

func (*MysqlDBConfig) Insert

func (DBConfig *MysqlDBConfig) Insert(data map[string]string, isRows bool) (rows int64, err error)

* 插入数据 isRows true 返回影响的行数 FALSE 返回最后一行的主键ID

func (*MysqlDBConfig) IsPrintSql

func (DBConfig *MysqlDBConfig) IsPrintSql(mode bool) *MysqlDBConfig

* 是否打印SQL

func (*MysqlDBConfig) Join

func (DBConfig *MysqlDBConfig) Join(str string, mode string) *MysqlDBConfig

* 连表操作,支持链式,支持重复调用

func (*MysqlDBConfig) OrderBy

func (DBConfig *MysqlDBConfig) OrderBy(str string, mode string) *MysqlDBConfig

* 设置排序条件,支持链式,不支持重复调用

func (*MysqlDBConfig) Select

func (DBConfig *MysqlDBConfig) Select() (result map[int]map[string]string, err error)

* 查询数据, 返回结果map

func (*MysqlDBConfig) TableName

func (DBConfig *MysqlDBConfig) TableName(str string) *MysqlDBConfig

* 设置数据表

func (*MysqlDBConfig) Update

func (DBConfig *MysqlDBConfig) Update(data map[string]string, isRows bool) (rows int64, err error)

* 修改数据 isRows true 返回影响的行数 FALSE 返回最后一行的主键ID

func (*MysqlDBConfig) Where

func (DBConfig *MysqlDBConfig) Where(str string, mode string) *MysqlDBConfig

* 设置WHERE条件,支持链式重复调用

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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