Documentation ¶
Index ¶
- type DeleteOneByNameWhereParameter
- type DeleteOneOrderByIDAscWhereParameter
- type DeleteOneOrderByIDDescLimitCountLimitParameter
- type DeleteOneOrderByIDDescLimitCountWhereParameter
- type DeleteOneOrderByIDDescWhereParameter
- type DeleteOneWhereParameter
- type FindAllCountResult
- type FindAllCountWhereResult
- type FindAllCountWhereWhereParameter
- type FindAvgIDResult
- type FindGroupHavingLimitOffsetHavingParameter
- type FindGroupHavingLimitOffsetLimitParameter
- type FindGroupHavingLimitOffsetWhereParameter
- type FindGroupHavingOrderAscLimitOffsetHavingParameter
- type FindGroupHavingOrderAscLimitOffsetLimitParameter
- type FindGroupHavingOrderAscLimitOffsetWhereParameter
- type FindGroupHavingOrderDescLimitOffsetHavingParameter
- type FindGroupHavingOrderDescLimitOffsetLimitParameter
- type FindGroupHavingOrderDescLimitOffsetWhereParameter
- type FindGroupLimitOffsetLimitParameter
- type FindGroupLimitOffsetWhereParameter
- type FindLimitLimitParameter
- type FindLimitOffsetLimitParameter
- type FindLimitWhereParameter
- type FindMaxIDResult
- type FindMinIDResult
- type FindOneByNameWhereParameter
- type FindOneGroupByNameHavingNameHavingParameter
- type FindOneGroupByNameHavingNameWhereParameter
- type FindOneGroupByNameWhereParameter
- type FindOnePartWhereParameter
- type FindOneWhereParameter
- type Scanner
- type UpdateOrderByIdDescLimitCountLimitParameter
- type UpdateOrderByIdDescLimitCountWhereParameter
- type UpdateOrderByIdDescWhereParameter
- type UpdateWhereParameter
- type User
- type UserModel
- func (m *UserModel) Create(ctx context.Context, data ...*User) error
- func (m *UserModel) Customize(ctx context.Context, args ...interface{})
- func (m *UserModel) DeleteOne(ctx context.Context, where DeleteOneWhereParameter) error
- func (m *UserModel) DeleteOneByName(ctx context.Context, where DeleteOneByNameWhereParameter) error
- func (m *UserModel) DeleteOneOrderByIDAsc(ctx context.Context, where DeleteOneOrderByIDAscWhereParameter) error
- func (m *UserModel) DeleteOneOrderByIDDesc(ctx context.Context, where DeleteOneOrderByIDDescWhereParameter) error
- func (m *UserModel) DeleteOneOrderByIDDescLimitCount(ctx context.Context, where DeleteOneOrderByIDDescLimitCountWhereParameter, ...) error
- func (m *UserModel) FindAll(ctx context.Context) (result []*User, err error)
- func (m *UserModel) FindAllCount(ctx context.Context) (result *FindAllCountResult, err error)
- func (m *UserModel) FindAllCountWhere(ctx context.Context, where FindAllCountWhereWhereParameter) (result *FindAllCountWhereResult, err error)
- func (m *UserModel) FindAvgID(ctx context.Context) (result *FindAvgIDResult, err error)
- func (m *UserModel) FindGroupHavingLimitOffset(ctx context.Context, where FindGroupHavingLimitOffsetWhereParameter, ...) (result []*User, err error)
- func (m *UserModel) FindGroupHavingOrderAscLimitOffset(ctx context.Context, where FindGroupHavingOrderAscLimitOffsetWhereParameter, ...) (result []*User, err error)
- func (m *UserModel) FindGroupHavingOrderDescLimitOffset(ctx context.Context, where FindGroupHavingOrderDescLimitOffsetWhereParameter, ...) (result []*User, err error)
- func (m *UserModel) FindGroupLimitOffset(ctx context.Context, where FindGroupLimitOffsetWhereParameter, ...) (result []*User, err error)
- func (m *UserModel) FindLimit(ctx context.Context, where FindLimitWhereParameter, ...) (result []*User, err error)
- func (m *UserModel) FindLimitOffset(ctx context.Context, limit FindLimitOffsetLimitParameter) (result []*User, err error)
- func (m *UserModel) FindMaxID(ctx context.Context) (result *FindMaxIDResult, err error)
- func (m *UserModel) FindMinID(ctx context.Context) (result *FindMinIDResult, err error)
- func (m *UserModel) FindOne(ctx context.Context, where FindOneWhereParameter) (result *User, err error)
- func (m *UserModel) FindOneByName(ctx context.Context, where FindOneByNameWhereParameter) (result *User, err error)
- func (m *UserModel) FindOneGroupByName(ctx context.Context, where FindOneGroupByNameWhereParameter) (result *User, err error)
- func (m *UserModel) FindOneGroupByNameHavingName(ctx context.Context, where FindOneGroupByNameHavingNameWhereParameter, ...) (result *User, err error)
- func (m *UserModel) FindOnePart(ctx context.Context, where FindOnePartWhereParameter) (result *User, err error)
- func (m *UserModel) Update(ctx context.Context, data *User, where UpdateWhereParameter) error
- func (m *UserModel) UpdateOrderByIdDesc(ctx context.Context, data *User, where UpdateOrderByIdDescWhereParameter) error
- func (m *UserModel) UpdateOrderByIdDescLimitCount(ctx context.Context, data *User, ...) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type DeleteOneByNameWhereParameter ¶
type DeleteOneByNameWhereParameter struct {
NameEqual string
}
DeleteOneByNameWhereParameter is a where parameter structure.
type DeleteOneOrderByIDAscWhereParameter ¶
type DeleteOneOrderByIDAscWhereParameter struct {
NameEqual string
}
DeleteOneOrderByIDAscWhereParameter is a where parameter structure.
type DeleteOneOrderByIDDescLimitCountLimitParameter ¶
type DeleteOneOrderByIDDescLimitCountLimitParameter struct {
Count int
}
DeleteOneOrderByIDDescLimitCountLimitParameter is a limit parameter structure.
type DeleteOneOrderByIDDescLimitCountWhereParameter ¶
type DeleteOneOrderByIDDescLimitCountWhereParameter struct {
NameEqual string
}
DeleteOneOrderByIDDescLimitCountWhereParameter is a where parameter structure.
type DeleteOneOrderByIDDescWhereParameter ¶
type DeleteOneOrderByIDDescWhereParameter struct {
NameEqual string
}
DeleteOneOrderByIDDescWhereParameter is a where parameter structure.
type DeleteOneWhereParameter ¶
type DeleteOneWhereParameter struct {
IdEqual uint64
}
DeleteOneWhereParameter is a where parameter structure.
type FindAllCountResult ¶
FindAllCountResult is a find all count result.
type FindAllCountWhereResult ¶
FindAllCountWhereResult is a find all count where result.
type FindAllCountWhereWhereParameter ¶
type FindAllCountWhereWhereParameter struct {
IdGT uint64
}
FindAllCountWhereWhereParameter is a where parameter structure.
type FindAvgIDResult ¶
type FindAvgIDResult struct {
AvgID decimal.NullDecimal `json:"avgID"`
}
FindAvgIDResult is a find avg id result.
type FindGroupHavingLimitOffsetHavingParameter ¶
type FindGroupHavingLimitOffsetHavingParameter struct {
IdGT uint64
}
FindGroupHavingLimitOffsetHavingParameter is a having parameter structure.
type FindGroupHavingLimitOffsetLimitParameter ¶
FindGroupHavingLimitOffsetLimitParameter is a limit parameter structure.
type FindGroupHavingLimitOffsetWhereParameter ¶
type FindGroupHavingLimitOffsetWhereParameter struct {
IdGT uint64
}
FindGroupHavingLimitOffsetWhereParameter is a where parameter structure.
type FindGroupHavingOrderAscLimitOffsetHavingParameter ¶
type FindGroupHavingOrderAscLimitOffsetHavingParameter struct {
IdGT uint64
}
FindGroupHavingOrderAscLimitOffsetHavingParameter is a having parameter structure.
type FindGroupHavingOrderAscLimitOffsetLimitParameter ¶
FindGroupHavingOrderAscLimitOffsetLimitParameter is a limit parameter structure.
type FindGroupHavingOrderAscLimitOffsetWhereParameter ¶
type FindGroupHavingOrderAscLimitOffsetWhereParameter struct {
IdGT uint64
}
FindGroupHavingOrderAscLimitOffsetWhereParameter is a where parameter structure.
type FindGroupHavingOrderDescLimitOffsetHavingParameter ¶
type FindGroupHavingOrderDescLimitOffsetHavingParameter struct {
IdGT uint64
}
FindGroupHavingOrderDescLimitOffsetHavingParameter is a having parameter structure.
type FindGroupHavingOrderDescLimitOffsetLimitParameter ¶
FindGroupHavingOrderDescLimitOffsetLimitParameter is a limit parameter structure.
type FindGroupHavingOrderDescLimitOffsetWhereParameter ¶
type FindGroupHavingOrderDescLimitOffsetWhereParameter struct {
IdGT uint64
}
FindGroupHavingOrderDescLimitOffsetWhereParameter is a where parameter structure.
type FindGroupLimitOffsetLimitParameter ¶
FindGroupLimitOffsetLimitParameter is a limit parameter structure.
type FindGroupLimitOffsetWhereParameter ¶
type FindGroupLimitOffsetWhereParameter struct {
IdGT uint64
}
FindGroupLimitOffsetWhereParameter is a where parameter structure.
type FindLimitLimitParameter ¶
type FindLimitLimitParameter struct {
Count int
}
FindLimitLimitParameter is a limit parameter structure.
type FindLimitOffsetLimitParameter ¶
FindLimitOffsetLimitParameter is a limit parameter structure.
type FindLimitWhereParameter ¶
type FindLimitWhereParameter struct {
IdGT uint64
}
FindLimitWhereParameter is a where parameter structure.
type FindMaxIDResult ¶
FindMaxIDResult is a find max id result.
type FindMinIDResult ¶
FindMinIDResult is a find min id result.
type FindOneByNameWhereParameter ¶
type FindOneByNameWhereParameter struct {
NameEqual string
}
FindOneByNameWhereParameter is a where parameter structure.
type FindOneGroupByNameHavingNameHavingParameter ¶
type FindOneGroupByNameHavingNameHavingParameter struct {
NameEqual string
}
FindOneGroupByNameHavingNameHavingParameter is a having parameter structure.
type FindOneGroupByNameHavingNameWhereParameter ¶
type FindOneGroupByNameHavingNameWhereParameter struct {
NameEqual string
}
FindOneGroupByNameHavingNameWhereParameter is a where parameter structure.
type FindOneGroupByNameWhereParameter ¶
type FindOneGroupByNameWhereParameter struct {
NameEqual string
}
FindOneGroupByNameWhereParameter is a where parameter structure.
type FindOnePartWhereParameter ¶
type FindOnePartWhereParameter struct {
IdGT uint64
}
FindOnePartWhereParameter is a where parameter structure.
type FindOneWhereParameter ¶
type FindOneWhereParameter struct {
IdEqual uint64
}
FindOneWhereParameter is a where parameter structure.
type UpdateOrderByIdDescLimitCountLimitParameter ¶
type UpdateOrderByIdDescLimitCountLimitParameter struct {
Count int
}
UpdateOrderByIdDescLimitCountLimitParameter is a limit parameter structure.
type UpdateOrderByIdDescLimitCountWhereParameter ¶
type UpdateOrderByIdDescLimitCountWhereParameter struct {
IdEqual uint64
}
UpdateOrderByIdDescLimitCountWhereParameter is a where parameter structure.
type UpdateOrderByIdDescWhereParameter ¶
type UpdateOrderByIdDescWhereParameter struct {
IdEqual uint64
}
UpdateOrderByIdDescWhereParameter is a where parameter structure.
type UpdateWhereParameter ¶
type UpdateWhereParameter struct {
IdEqual uint64
}
UpdateWhereParameter is a where parameter structure.
type User ¶
type User struct { Id uint64 `json:"id"` Name string `json:"name"` // The username Password string `json:"password"` // The user password Mobile string `json:"mobile"` // The mobile phone number Gender string `json:"gender"` // gender,male|female|unknown Nickname string `json:"nickname"` // The nickname Type int8 `json:"type"` // The user type, 0:normal,1:vip, for test golang keyword CreateAt time.Time `json:"createAt"` UpdateAt time.Time `json:"updateAt"` }
User represents a user struct data.
type UserModel ¶
type UserModel struct {
// contains filtered or unexported fields
}
UserModel represents a user model.
func NewUserModel ¶
NewUserModel creates a new user model.
func (*UserModel) DeleteOne ¶
func (m *UserModel) DeleteOne(ctx context.Context, where DeleteOneWhereParameter) error
DeleteOne is generated from sql: delete from `user` where `id` = ?;
func (*UserModel) DeleteOneByName ¶
func (m *UserModel) DeleteOneByName(ctx context.Context, where DeleteOneByNameWhereParameter) error
DeleteOneByName is generated from sql: delete from `user` where `name` = ?;
func (*UserModel) DeleteOneOrderByIDAsc ¶
func (m *UserModel) DeleteOneOrderByIDAsc(ctx context.Context, where DeleteOneOrderByIDAscWhereParameter) error
DeleteOneOrderByIDAsc is generated from sql: delete from `user` where `name` = ? order by id;
func (*UserModel) DeleteOneOrderByIDDesc ¶
func (m *UserModel) DeleteOneOrderByIDDesc(ctx context.Context, where DeleteOneOrderByIDDescWhereParameter) error
DeleteOneOrderByIDDesc is generated from sql: delete from `user` where `name` = ? order by id desc;
func (*UserModel) DeleteOneOrderByIDDescLimitCount ¶
func (m *UserModel) DeleteOneOrderByIDDescLimitCount(ctx context.Context, where DeleteOneOrderByIDDescLimitCountWhereParameter, limit DeleteOneOrderByIDDescLimitCountLimitParameter) error
DeleteOneOrderByIDDescLimitCount is generated from sql: delete from `user` where `name` = ? order by id desc limit ?;
func (*UserModel) FindAllCount ¶
func (m *UserModel) FindAllCount(ctx context.Context) (result *FindAllCountResult, err error)
FindAllCount is generated from sql: select count(id) AS countID from `user`;
func (*UserModel) FindAllCountWhere ¶
func (m *UserModel) FindAllCountWhere(ctx context.Context, where FindAllCountWhereWhereParameter) (result *FindAllCountWhereResult, err error)
FindAllCountWhere is generated from sql: select count(id) AS countID from `user` where id > ?;
func (*UserModel) FindAvgID ¶
func (m *UserModel) FindAvgID(ctx context.Context) (result *FindAvgIDResult, err error)
FindAvgID is generated from sql: select avg(id) AS avgID from `user`;
func (*UserModel) FindGroupHavingLimitOffset ¶
func (m *UserModel) FindGroupHavingLimitOffset(ctx context.Context, where FindGroupHavingLimitOffsetWhereParameter, having FindGroupHavingLimitOffsetHavingParameter, limit FindGroupHavingLimitOffsetLimitParameter) (result []*User, err error)
FindGroupHavingLimitOffset is generated from sql: select * from `user` where id > ? group by name having id > ? limit ?, ?;
func (*UserModel) FindGroupHavingOrderAscLimitOffset ¶
func (m *UserModel) FindGroupHavingOrderAscLimitOffset(ctx context.Context, where FindGroupHavingOrderAscLimitOffsetWhereParameter, having FindGroupHavingOrderAscLimitOffsetHavingParameter, limit FindGroupHavingOrderAscLimitOffsetLimitParameter) (result []*User, err error)
FindGroupHavingOrderAscLimitOffset is generated from sql: select * from `user` where id > ? group by name having id > ? order by id limit ?, ?;
func (*UserModel) FindGroupHavingOrderDescLimitOffset ¶
func (m *UserModel) FindGroupHavingOrderDescLimitOffset(ctx context.Context, where FindGroupHavingOrderDescLimitOffsetWhereParameter, having FindGroupHavingOrderDescLimitOffsetHavingParameter, limit FindGroupHavingOrderDescLimitOffsetLimitParameter) (result []*User, err error)
FindGroupHavingOrderDescLimitOffset is generated from sql: select * from `user` where id > ? group by name having id > ? order by id desc limit ?, ?;
func (*UserModel) FindGroupLimitOffset ¶
func (m *UserModel) FindGroupLimitOffset(ctx context.Context, where FindGroupLimitOffsetWhereParameter, limit FindGroupLimitOffsetLimitParameter) (result []*User, err error)
FindGroupLimitOffset is generated from sql: select * from `user` where id > ? group by name limit ?, ?;
func (*UserModel) FindLimit ¶
func (m *UserModel) FindLimit(ctx context.Context, where FindLimitWhereParameter, limit FindLimitLimitParameter) (result []*User, err error)
FindLimit is generated from sql: select * from `user` where id > ? limit ?;
func (*UserModel) FindLimitOffset ¶
func (m *UserModel) FindLimitOffset(ctx context.Context, limit FindLimitOffsetLimitParameter) (result []*User, err error)
FindLimitOffset is generated from sql: select * from `user` limit ?, ?;
func (*UserModel) FindMaxID ¶
func (m *UserModel) FindMaxID(ctx context.Context) (result *FindMaxIDResult, err error)
FindMaxID is generated from sql: select max(id) AS maxID from `user`;
func (*UserModel) FindMinID ¶
func (m *UserModel) FindMinID(ctx context.Context) (result *FindMinIDResult, err error)
FindMinID is generated from sql: select min(id) AS minID from `user`;
func (*UserModel) FindOne ¶
func (m *UserModel) FindOne(ctx context.Context, where FindOneWhereParameter) (result *User, err error)
FindOne is generated from sql: select * from `user` where `id` = ? limit 1;
func (*UserModel) FindOneByName ¶
func (m *UserModel) FindOneByName(ctx context.Context, where FindOneByNameWhereParameter) (result *User, err error)
FindOneByName is generated from sql: select * from `user` where `name` = ? limit 1;
func (*UserModel) FindOneGroupByName ¶
func (m *UserModel) FindOneGroupByName(ctx context.Context, where FindOneGroupByNameWhereParameter) (result *User, err error)
FindOneGroupByName is generated from sql: select * from `user` where `name` = ? group by name limit 1;
func (*UserModel) FindOneGroupByNameHavingName ¶
func (m *UserModel) FindOneGroupByNameHavingName(ctx context.Context, where FindOneGroupByNameHavingNameWhereParameter, having FindOneGroupByNameHavingNameHavingParameter) (result *User, err error)
FindOneGroupByNameHavingName is generated from sql: select * from `user` where `name` = ? group by name having name = ? limit 1;
func (*UserModel) FindOnePart ¶
func (m *UserModel) FindOnePart(ctx context.Context, where FindOnePartWhereParameter) (result *User, err error)
FindOnePart is generated from sql: select `name`, `password`, `mobile` from `user` where id > ? limit 1;
func (*UserModel) Update ¶
Update is generated from sql: update `user` set `name` = ?, `password` = ?, `mobile` = ?, `gender` = ?, `nickname` = ?, `type` = ?, `create_at` = ?, `update_at` = ? where `id` = ?;
func (*UserModel) UpdateOrderByIdDesc ¶
func (m *UserModel) UpdateOrderByIdDesc(ctx context.Context, data *User, where UpdateOrderByIdDescWhereParameter) error
UpdateOrderByIdDesc is generated from sql: update `user` set `name` = ?, `password` = ?, `mobile` = ?, `gender` = ?, `nickname` = ?, `type` = ?, `create_at` = ?, `update_at` = ? where `id` = ? order by id desc;
func (*UserModel) UpdateOrderByIdDescLimitCount ¶
func (m *UserModel) UpdateOrderByIdDescLimitCount(ctx context.Context, data *User, where UpdateOrderByIdDescLimitCountWhereParameter, limit UpdateOrderByIdDescLimitCountLimitParameter) error
UpdateOrderByIdDescLimitCount is generated from sql: update `user` set `name` = ?, `password` = ?, `mobile` = ?, `gender` = ?, `nickname` = ?, `type` = ?, `create_at` = ?, `update_at` = ? where `id` = ? order by id desc limit ?;