user

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Nov 15, 2019 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Delete

func Delete(db *sql.DB, where, data map[string]interface{}) (int64, error)

Delete deletes matched records in user

func GetCount

func GetCount(db *sql.DB, where map[string]interface{}) (int64, error)

GetCount

func Insert

func Insert(db *sql.DB, data []map[string]interface{}) (int64, error)

Insert inserts an array of data into table user

func Update

func Update(db *sql.DB, where, data map[string]interface{}) (int64, error)

Update updates the table user

Types

type User

type User struct {
	ID       uint      `ddb:"id"`
	Name     string    `ddb:"name"`
	Age      byte      `ddb:"age"`
	Gender   int8      `ddb:"gender"`
	Avatar   string    `ddb:"avatar"`
	Email    string    `ddb:"email"`
	Phone    string    `ddb:"phone"`
	Password string    `ddb:"password"`
	Salt     string    `ddb:"salt"`
	UpdateAt time.Time `ddb:"update_at"`
	CreateAt time.Time `ddb:"create_at"`
	Status   int8      `ddb:"status"`
}

User is a mapping object for user table in mysql

func GetMulti

func GetMulti(db *sql.DB, where map[string]interface{}) ([]*User, error)

GetMulti gets multiple records from table user by condition "where"

func GetOne

func GetOne(db *sql.DB, where map[string]interface{}) (*User, error)

GetOne gets one record from table user by condition "where"

Jump to

Keyboard shortcuts

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