Documentation ¶
Index ¶
- Variables
- func Delete(where ...interface{}) (result sql.Result, err error)
- func FindArray(fieldsAndWhere ...interface{}) ([]gdb.Value, error)
- func FindCount(where ...interface{}) (int, error)
- func FindValue(fieldsAndWhere ...interface{}) (gdb.Value, error)
- func Insert(data ...interface{}) (result sql.Result, err error)
- func InsertIgnore(data ...interface{}) (result sql.Result, err error)
- func Replace(data ...interface{}) (result sql.Result, err error)
- func Save(data ...interface{}) (result sql.Result, err error)
- func Update(dataAndWhere ...interface{}) (result sql.Result, err error)
- type Entity
- func (r *Entity) Delete() (result sql.Result, err error)
- func (r *Entity) Insert() (result sql.Result, err error)
- func (r *Entity) InsertIgnore() (result sql.Result, err error)
- func (r *Entity) OmitEmpty() *arModel
- func (r *Entity) Replace() (result sql.Result, err error)
- func (r *Entity) Save() (result sql.Result, err error)
- func (r *Entity) Update() (result sql.Result, err error)
Constants ¶
This section is empty.
Variables ¶
var ( // Table is the table name of gf_user_detail. Table = "gf_user_detail" // Model is the model object of gf_user_detail. Model = &arModel{g.DB("default").Table(Table).Safe()} // Columns defines and stores column names for table gf_user_detail. Columns = struct { Uid string // UID TrueName string // 真实姓名 IdNumber string // 身份证号 City string // 城市 Birth string // 出生日期\n(字符串,例如:1986-10-07 00:00:00) Phone string // 手机号码 Qq string // QQ Email string // 邮件 From string // 用户来源 Brief string // 用户说明 }{ Uid: "uid", TrueName: "true_name", IdNumber: "id_number", City: "city", Birth: "birth", Phone: "phone", Qq: "qq", Email: "email", From: "from", Brief: "brief", } )
Functions ¶
func InsertIgnore ¶
InsertIgnore is a convenience method for Model.InsertIgnore.
Types ¶
type Entity ¶
type Entity struct { Uid uint `orm:"uid,primary" json:"uid"` // UID TrueName string `orm:"true_name" json:"true_name"` // 真实姓名 IdNumber string `orm:"id_number" json:"id_number"` // 身份证号 City string `orm:"city" json:"city"` // 城市 Birth *gtime.Time `orm:"birth" json:"birth"` // 出生日期\n(字符串,例如:1986-10-07 00:00:00) Phone string `orm:"phone" json:"phone"` // 手机号码 Qq string `orm:"qq" json:"qq"` // QQ Email string `orm:"email" json:"email"` // 邮件 From string `orm:"from" json:"from"` // 用户来源 Brief string `orm:"brief" json:"brief"` // 用户说明 Remark string `orm:"remark" json:"remark"` // 额外信息 }
Entity is the golang structure for table gf_user_detail.
func (*Entity) Delete ¶
Delete does "DELETE FROM...WHERE..." statement for deleting current object from table.
func (*Entity) Insert ¶
Inserts does "INSERT...INTO..." statement for inserting current object into table.
func (*Entity) InsertIgnore ¶
InsertIgnore does "INSERT IGNORE INTO ..." statement for inserting current object into table.
func (*Entity) OmitEmpty ¶
func (r *Entity) OmitEmpty() *arModel
OmitEmpty sets OPTION_OMITEMPTY option for the model, which automatically filers the data and where attributes for empty values.
func (*Entity) Replace ¶
Replace does "REPLACE...INTO..." statement for inserting current object into table. If there's already another same record in the table (it checks using primary key or unique index), it deletes it and insert this one.