xdb

package
v0.2.56 Latest Latest
Warning

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

Go to latest
Published: Aug 6, 2020 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CreateMany

func CreateMany(db *gorm.DB, data ...interface{}) (err error)

func CreateOne

func CreateOne(db *gorm.DB, data interface{}) (err error)

func Delete

func Delete(db *gorm.DB, model interface{}, filter map[string]interface{}) (err error)

func FindMany

func FindMany(db *gorm.DB, filter map[string]interface{}, data []interface{}) (err error)

func FindOne

func FindOne(db *gorm.DB, filter map[string]interface{}, data interface{}) (err error)

func Paginate

func Paginate(db *gorm.DB, pageSize, pageIndex int64, filter map[string]interface{}, data []interface{}) (err error)

func SearchObject

func SearchObject(db *gorm.DB, wheres map[string]interface{}, out interface{}) error

func SearchObjectByIn

func SearchObjectByIn(db *gorm.DB, wheres map[string]interface{},
	ins map[string]interface{}, out interface{}) error

func SearchObjectByOrder

func SearchObjectByOrder(db *gorm.DB, wheres map[string]interface{}, ins map[string]interface{},
	orders string, limit, offset int, out interface{}) error

func TableCols

func TableCols(db *sql.DB, tbNames ...string) (map[string]TbCol, error)

func TableNames

func TableNames(db *sql.DB) ([]string, error)

func Update

func Update(db *gorm.DB, data interface{}) (err error)

func UpdateObject

func UpdateObject(db *gorm.DB, wheres, updates map[string]interface{}) error

updates maybe use gorm.Expr()

func UpdateObjectIns

func UpdateObjectIns(db *gorm.DB, wheres, ins, updates map[string]interface{}) error

func ViewNames

func ViewNames(db *sql.DB) ([]string, error)

Types

type Person

type Person struct {
	FirstName string `db:"first_name"`
	LastName  string `db:"last_name"`
	Email     string
}

type Place

type Place struct {
	Country string
	City    sql.NullString
	TelCode int
}

type TbCol

type TbCol struct {
}

Jump to

Keyboard shortcuts

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