configurations

package
v0.0.0-...-e212f3b Latest Latest
Warning

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

Go to latest
Published: Mar 3, 2020 License: GPL-3.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// ColumnIdentifier - the identifier column of entity.
	ColumnIdentifier = "identifier"
	// ColumnValue - the key column of entity.
	ColumnValue = "value"
)

Variables

View Source
var (
	// Table is the table name of configurations.
	Table = "configurations"
	// Model is the model object of configurations.
	Model = &arModel{g.DB("default").Table(Table).Safe()}
)

Functions

func Delete

func Delete(where ...interface{}) (result sql.Result, err error)

Delete is a convenience method for Model.Delete.

func FindCount

func FindCount(where ...interface{}) (int, error)

FindCount is a convenience method for Model.FindCount. See Model.FindCount.

func FindValue

func FindValue(fieldsAndWhere ...interface{}) (gdb.Value, error)

FindValue is a convenience method for Model.FindValue. See Model.FindValue.

func GetCurrentSeasonID

func GetCurrentSeasonID() int

GetCurrentSeasonID - get currrent season id for other services.

func Insert

func Insert(data ...interface{}) (result sql.Result, err error)

Insert is a convenience method for Model.Insert.

func Replace

func Replace(data ...interface{}) (result sql.Result, err error)

Replace is a convenience method for Model.Replace.

func Save

func Save(data ...interface{}) (result sql.Result, err error)

Save is a convenience method for Model.Save.

func Update

func Update(dataAndWhere ...interface{}) (result sql.Result, err error)

Update is a convenience method for Model.Update.

Types

type Entity

type Entity struct {
	Key   string `orm:"key,primary" json:"key"`   //
	Value string `orm:"value"       json:"value"` //
}

Entity is the golang structure for table configurations.

func FindAll

func FindAll(where ...interface{}) ([]*Entity, error)

FindAll is a convenience method for Model.FindAll. See Model.FindAll.

func FindOne

func FindOne(where ...interface{}) (*Entity, error)

FindOne is a convenience method for Model.FindOne. See Model.FindOne.

func (*Entity) Delete

func (r *Entity) Delete() (result sql.Result, err error)

Delete does "DELETE FROM...WHERE..." statement for deleting current object from table.

func (*Entity) Insert

func (r *Entity) Insert() (result sql.Result, err error)

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

func (r *Entity) Replace() (result sql.Result, err error)

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.

func (*Entity) Save

func (r *Entity) Save() (result sql.Result, err error)

Save does "INSERT...INTO..." statement for inserting/updating current object into table. It updates the record if there's already another same record in the table (it checks using primary key or unique index).

func (*Entity) Update

func (r *Entity) Update() (result sql.Result, err error)

Update does "UPDATE...WHERE..." statement for updating current object from table. It updates the record if there's already another same record in the table (it checks using primary key or unique index).

Jump to

Keyboard shortcuts

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