sql_aid

package
v0.0.0-...-30be18a Latest Latest
Warning

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

Go to latest
Published: Aug 1, 2022 License: Unlicense Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DataToMap

func DataToMap(rows *sql.Rows, err error) ([]map[string]interface{}, error)

DataToMap 处理数据

func Open

func Open(sqlType string, databaseLine string) (*sql.DB, error)

Open 建立链接,,实现单例模式

Types

type MyChildQuery

type MyChildQuery func(*MyQuery, ...interface{})

type MyQuery

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

func MyTable

func MyTable(table string) *MyQuery

func (*MyQuery) Dec

func (db *MyQuery) Dec(field string, data interface{}) *MyQuery

func (*MyQuery) DecAll

func (db *MyQuery) DecAll(decMap map[string]interface{}) *MyQuery

func (*MyQuery) Delete

func (db *MyQuery) Delete() (string, []interface{})

Delete 删除方法

func (*MyQuery) Field

func (db *MyQuery) Field(field ...string) *MyQuery

func (*MyQuery) GroupBy

func (db *MyQuery) GroupBy(groupBy string) *MyQuery

func (*MyQuery) Inc

func (db *MyQuery) Inc(field string, data interface{}) *MyQuery

func (*MyQuery) IncAll

func (db *MyQuery) IncAll(incMap map[string]interface{}) *MyQuery

func (*MyQuery) InsertAllByMap

func (db *MyQuery) InsertAllByMap(datas *[]map[string]interface{}) (string, []interface{})

func (*MyQuery) InsertAllByStruct

func (db *MyQuery) InsertAllByStruct(datas []interface{}) (string, []interface{})

func (*MyQuery) InsertByMap

func (db *MyQuery) InsertByMap(data map[string]interface{}) (string, []interface{})

func (*MyQuery) InsertByStruct

func (db *MyQuery) InsertByStruct(data interface{}) (string, []interface{})

func (*MyQuery) OrderBy

func (db *MyQuery) OrderBy(Order string) *MyQuery

func (*MyQuery) PageSize

func (db *MyQuery) PageSize(page string, size string) *MyQuery

func (*MyQuery) Table

func (db *MyQuery) Table(Table string) *MyQuery

func (*MyQuery) ToSql

func (db *MyQuery) ToSql() (string, []interface{})

func (*MyQuery) UpdateByMap

func (db *MyQuery) UpdateByMap(data map[string]interface{}) (string, []interface{})

func (*MyQuery) UpdateByStruct

func (db *MyQuery) UpdateByStruct(data interface{}) (string, []interface{})

func (*MyQuery) Where

func (db *MyQuery) Where(field string, val interface{}) *MyQuery

func (*MyQuery) WhereId

func (db *MyQuery) WhereId(id interface{}) *MyQuery

func (*MyQuery) WhereIn

func (db *MyQuery) WhereIn(field string, condition ...interface{}) *MyQuery

func (*MyQuery) WhereInRaw

func (db *MyQuery) WhereInRaw(field string, childQuery MyChildQuery, val ...interface{}) *MyQuery

func (*MyQuery) WhereNotIn

func (db *MyQuery) WhereNotIn(field string, condition ...interface{}) *MyQuery

func (*MyQuery) WhereNotInRaw

func (db *MyQuery) WhereNotInRaw(field string, childQuery MyChildQuery, val ...interface{}) *MyQuery

func (*MyQuery) WhereOr

func (db *MyQuery) WhereOr(field string, val interface{}) *MyQuery

func (*MyQuery) WhereOrRaw

func (db *MyQuery) WhereOrRaw(childQuery MyChildQuery, val ...interface{}) *MyQuery

func (*MyQuery) WhereRaw

func (db *MyQuery) WhereRaw(childQuery MyChildQuery, val ...interface{}) *MyQuery

type PgChildQuery

type PgChildQuery func(*PgQuery, ...interface{})

type PgQuery

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

func PgTable

func PgTable(table string) *PgQuery

func (*PgQuery) Dec

func (db *PgQuery) Dec(field string, data interface{}) *PgQuery

func (*PgQuery) DecAll

func (db *PgQuery) DecAll(decMap map[string]interface{}) *PgQuery

func (*PgQuery) Delete

func (db *PgQuery) Delete() (string, []interface{})

Delete 删除方法

func (*PgQuery) Field

func (db *PgQuery) Field(field ...string) *PgQuery

func (*PgQuery) GroupBy

func (db *PgQuery) GroupBy(groupBy string) *PgQuery

func (*PgQuery) Inc

func (db *PgQuery) Inc(field string, data interface{}) *PgQuery

func (*PgQuery) IncAll

func (db *PgQuery) IncAll(incMap map[string]interface{}) *PgQuery

func (*PgQuery) InsertAllByMap

func (db *PgQuery) InsertAllByMap(datas *[]map[string]interface{}) (string, []interface{})

func (*PgQuery) InsertAllByStruct

func (db *PgQuery) InsertAllByStruct(datas []interface{}) (string, []interface{})

func (*PgQuery) InsertByMap

func (db *PgQuery) InsertByMap(data map[string]interface{}) (string, []interface{})

func (*PgQuery) InsertByStruct

func (db *PgQuery) InsertByStruct(data interface{}) (string, []interface{})

func (*PgQuery) OrderBy

func (db *PgQuery) OrderBy(Order string) *PgQuery

func (*PgQuery) PageSize

func (db *PgQuery) PageSize(page string, size string) *PgQuery

func (*PgQuery) Table

func (db *PgQuery) Table(Table string) *PgQuery

func (*PgQuery) ToSql

func (db *PgQuery) ToSql() (string, []interface{})

func (*PgQuery) UpdateByMap

func (db *PgQuery) UpdateByMap(data map[string]interface{}) (string, []interface{})

func (*PgQuery) UpdateByStruct

func (db *PgQuery) UpdateByStruct(data interface{}) (string, []interface{})

func (*PgQuery) Where

func (db *PgQuery) Where(field string, val interface{}) *PgQuery

func (*PgQuery) WhereId

func (db *PgQuery) WhereId(id interface{}) *PgQuery

func (*PgQuery) WhereIn

func (db *PgQuery) WhereIn(field string, condition ...interface{}) *PgQuery

func (*PgQuery) WhereInRaw

func (db *PgQuery) WhereInRaw(field string, childQuery PgChildQuery, val ...interface{}) *PgQuery

func (*PgQuery) WhereNotIn

func (db *PgQuery) WhereNotIn(field string, condition ...interface{}) *PgQuery

func (*PgQuery) WhereNotInRaw

func (db *PgQuery) WhereNotInRaw(field string, childQuery PgChildQuery, val ...interface{}) *PgQuery

func (*PgQuery) WhereOr

func (db *PgQuery) WhereOr(field string, val interface{}) *PgQuery

func (*PgQuery) WhereOrRaw

func (db *PgQuery) WhereOrRaw(childQuery PgChildQuery, val ...interface{}) *PgQuery

func (*PgQuery) WhereRaw

func (db *PgQuery) WhereRaw(childQuery PgChildQuery, val ...interface{}) *PgQuery

Jump to

Keyboard shortcuts

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