Documentation
¶
Index ¶
- Variables
- func Delete(where ...interface{}) (result sql.Result, err error)
- func FindCount(where ...interface{}) (int, error)
- func FindValue(fieldsAndWhere ...interface{}) (gdb.Value, error)
- func Insert(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) 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 ¶
View Source
var ( // Table is the table name of contests. Table = "contests" // Model is the model object of contests. Model = &arModel{g.DB("default").Table(Table).Safe()} )
Functions ¶
Types ¶
type Entity ¶
type Entity struct { Id int64 `orm:"id,primary" json:"id"` // SeasonId int64 `orm:"season_id" json:"season_id"` // Name string `orm:"name" json:"name"` // Description string `orm:"description" json:"description"` // Url string `orm:"url" json:"url"` // the contest link, if it is online StartTime int64 `orm:"start_time" json:"start_time"` // the start time of the contest, as unix timestamp Duration int64 `orm:"duration" json:"duration"` // the duration of the contest, unit in seconds }
Entity is the golang structure for table contests.
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) 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.
Click to show internal directories.
Click to hide internal directories.