Documentation ¶
Index ¶
- type OrmUsers
- func (orm *OrmUsers) And(fuc func(orm *OrmUsers)) *OrmUsers
- func (orm *OrmUsers) Begin(opts ...*sql.TxOptions) *gorm.DB
- func (orm *OrmUsers) Commit() *gorm.DB
- func (orm *OrmUsers) Connection(fc func(tx *gorm.DB) error) (err error)
- func (orm *OrmUsers) Count() int64
- func (orm *OrmUsers) Create(value interface{}) *gorm.DB
- func (orm *OrmUsers) CreateInBatches(value interface{}, batchSize int) *gorm.DB
- func (orm *OrmUsers) Delete(conds ...interface{}) *gorm.DB
- func (orm *OrmUsers) DeleteAll() *gorm.DB
- func (orm *OrmUsers) Exec(sql string, values ...interface{}) *gorm.DB
- func (orm *OrmUsers) Find(conds ...interface{}) (UsersList, int64)
- func (orm *OrmUsers) FindInBatches(dest interface{}, batchSize int, fc func(tx *gorm.DB, batch int) error) *gorm.DB
- func (orm *OrmUsers) First(conds ...interface{}) (*Users, bool)
- func (orm *OrmUsers) FirstOrCreate(dest interface{}, conds ...interface{}) *gorm.DB
- func (orm *OrmUsers) FirstOrInit(dest *Users, conds ...interface{}) (*Users, *gorm.DB)
- func (orm *OrmUsers) Get() UsersList
- func (orm *OrmUsers) GetDB() *gorm.DB
- func (orm *OrmUsers) Insert(row *Users) *gorm.DB
- func (orm *OrmUsers) InsertGetEmail(row *Users) string
- func (orm *OrmUsers) InsertGetId(row *Users) int64
- func (orm *OrmUsers) Inserts(rows []*Users) *gorm.DB
- func (orm *OrmUsers) Last(conds ...interface{}) (*Users, int64)
- func (orm *OrmUsers) Limit(limit int) *OrmUsers
- func (orm *OrmUsers) Offset(offset int) *OrmUsers
- func (orm *OrmUsers) Or(fuc func(orm *OrmUsers)) *OrmUsers
- func (orm *OrmUsers) Order(value interface{}) *OrmUsers
- func (orm *OrmUsers) Pluck(column string, dest interface{}) *gorm.DB
- func (orm *OrmUsers) Rollback() *gorm.DB
- func (orm *OrmUsers) RollbackTo(name string) *gorm.DB
- func (orm *OrmUsers) Row() *sql.Row
- func (orm *OrmUsers) Rows() (*sql.Rows, error)
- func (orm *OrmUsers) Save(value interface{}) *gorm.DB
- func (orm *OrmUsers) SavePoint(name string) *gorm.DB
- func (orm *OrmUsers) Scan(dest interface{}) *gorm.DB
- func (orm *OrmUsers) ScanRows(rows *sql.Rows, dest interface{}) error
- func (orm *OrmUsers) Take(conds ...interface{}) (*Users, int64)
- func (orm *OrmUsers) Transaction(fc func(tx *gorm.DB) error, opts ...*sql.TxOptions) (err error)
- func (orm *OrmUsers) Update(column string, value interface{}) *gorm.DB
- func (orm *OrmUsers) UpdateColumn(column string, value interface{}) *gorm.DB
- func (orm *OrmUsers) UpdateColumns(values interface{}) *gorm.DB
- func (orm *OrmUsers) Updates(values interface{}) *gorm.DB
- func (orm *OrmUsers) Where(query interface{}, args ...interface{}) *OrmUsers
- func (orm *OrmUsers) WhereCreatedAt(val database.Time) *OrmUsers
- func (orm *OrmUsers) WhereCreatedAtBetween(begin database.Time, end database.Time) *OrmUsers
- func (orm *OrmUsers) WhereCreatedAtGte(val database.Time) *OrmUsers
- func (orm *OrmUsers) WhereCreatedAtLte(val database.Time) *OrmUsers
- func (orm *OrmUsers) WhereEmail(val string) *OrmUsers
- func (orm *OrmUsers) WhereEmailGt(val string) *OrmUsers
- func (orm *OrmUsers) WhereEmailGte(val string) *OrmUsers
- func (orm *OrmUsers) WhereEmailIn(val []string) *OrmUsers
- func (orm *OrmUsers) WhereEmailLt(val string) *OrmUsers
- func (orm *OrmUsers) WhereEmailLte(val string) *OrmUsers
- func (orm *OrmUsers) WhereEmailVerifiedAt(val database.Time) *OrmUsers
- func (orm *OrmUsers) WhereEmailVerifiedAtBetween(begin database.Time, end database.Time) *OrmUsers
- func (orm *OrmUsers) WhereEmailVerifiedAtGte(val database.Time) *OrmUsers
- func (orm *OrmUsers) WhereEmailVerifiedAtLte(val database.Time) *OrmUsers
- func (orm *OrmUsers) WhereId(val int64) *OrmUsers
- func (orm *OrmUsers) WhereIdGt(val int64) *OrmUsers
- func (orm *OrmUsers) WhereIdGte(val int64) *OrmUsers
- func (orm *OrmUsers) WhereIdIn(val []int64) *OrmUsers
- func (orm *OrmUsers) WhereIdLt(val int64) *OrmUsers
- func (orm *OrmUsers) WhereIdLte(val int64) *OrmUsers
- func (orm *OrmUsers) WhereName(val string) *OrmUsers
- func (orm *OrmUsers) WherePassword(val string) *OrmUsers
- func (orm *OrmUsers) WhereRememberToken(val string) *OrmUsers
- func (orm *OrmUsers) WhereUpdatedAt(val database.Time) *OrmUsers
- func (orm *OrmUsers) WhereUpdatedAtBetween(begin database.Time, end database.Time) *OrmUsers
- func (orm *OrmUsers) WhereUpdatedAtGte(val database.Time) *OrmUsers
- func (orm *OrmUsers) WhereUpdatedAtLte(val database.Time) *OrmUsers
- type Users
- type UsersList
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type OrmUsers ¶
type OrmUsers struct {
// contains filtered or unexported fields
}
func NewOrmUsers ¶
func NewOrmUsers() *OrmUsers
func (*OrmUsers) Connection ¶
Connection use a db conn to execute Multiple commands,this conn will put conn pool after it is executed.
func (*OrmUsers) CreateInBatches ¶
CreateInBatches insert the value in batches into database
func (*OrmUsers) FindInBatches ¶
func (orm *OrmUsers) FindInBatches(dest interface{}, batchSize int, fc func(tx *gorm.DB, batch int) error) *gorm.DB
FindInBatches find records in batches
func (*OrmUsers) FirstOrCreate ¶
FirstOrCreate gets the first matched record or create a new one with given conditions (only works with struct, map conditions)
func (*OrmUsers) FirstOrInit ¶
FirstOrInit gets the first matched record or initialize a new instance with given conditions (only works with struct or map conditions)
func (*OrmUsers) InsertGetEmail ¶
func (*OrmUsers) InsertGetId ¶
func (*OrmUsers) Pluck ¶
Pluck used to query single column from a model as a map
var ages []int64 db.Model(&users).Pluck("age", &ages)
func (*OrmUsers) Save ¶
Save update value in database, if the value doesn't have primary key, will insert it
func (*OrmUsers) Take ¶
Take return a record that match given conditions, the order will depend on the database implementation
func (*OrmUsers) Transaction ¶
Transaction start a transaction as a block, return error will rollback, otherwise to commit.
func (*OrmUsers) Update ¶
Update update attributes with callbacks, refer: https://gorm.io/docs/update.html#Update-Changed-Fields
func (*OrmUsers) UpdateColumn ¶
func (*OrmUsers) UpdateColumns ¶
func (*OrmUsers) Updates ¶
Updates update attributes with callbacks, refer: https://gorm.io/docs/update.html#Update-Changed-Fields
func (*OrmUsers) WhereCreatedAtBetween ¶
func (*OrmUsers) WhereCreatedAtGte ¶
func (*OrmUsers) WhereCreatedAtLte ¶
func (*OrmUsers) WhereEmail ¶
func (*OrmUsers) WhereEmailGt ¶
func (*OrmUsers) WhereEmailGte ¶
func (*OrmUsers) WhereEmailIn ¶
func (*OrmUsers) WhereEmailLt ¶
func (*OrmUsers) WhereEmailLte ¶
func (*OrmUsers) WhereEmailVerifiedAt ¶
func (*OrmUsers) WhereEmailVerifiedAtBetween ¶
func (*OrmUsers) WhereEmailVerifiedAtGte ¶
func (*OrmUsers) WhereEmailVerifiedAtLte ¶
func (*OrmUsers) WhereIdGte ¶
func (*OrmUsers) WhereIdLte ¶
func (*OrmUsers) WherePassword ¶
func (*OrmUsers) WhereRememberToken ¶
func (*OrmUsers) WhereUpdatedAtBetween ¶
func (*OrmUsers) WhereUpdatedAtGte ¶
type Users ¶
type Users struct { Id int64 `gorm:"column:id;autoIncrement;type:bigint(20) unsigned;primaryKey"` // Name string `gorm:"column:name;type:varchar(255)"` // Email string `gorm:"column:email;type:varchar(255);index:users_email_unique,class:HASH,unique"` // EmailVerifiedAt *database.Time `gorm:"column:email_verified_at;type:timestamp;default:NULL"` // Password string `gorm:"column:password;type:varchar(255)"` // RememberToken *string `gorm:"column:remember_token;type:varchar(100);default:NULL"` // CreatedAt *database.Time `gorm:"column:created_at;type:timestamp;default:NULL"` // UpdatedAt *database.Time `gorm:"column:updated_at;type:timestamp;default:NULL"` // }