Documentation
¶
Overview ¶
+gpa-ignore DO NOT EDIT THIS FILE +gpa-provides:Count,Delete,Find,FindBy,UserRepo,Teacher,RepoTruncate,Update, Generated by gpa at 2022-04-12 16:29:10
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Count ¶
type Count interface {
CountByName(user models.User) (int64, models.User, error)
// sql:select count(*) from "user" where id=:id and age>:age
CountName(user *models.User, name string) (int64, error)
// sql:select count(1) where id in :ids and age>:age
CountXName(user *models.User, name string, ids []uint64) (int64, error)
}
type Delete ¶
type Delete interface {
DeleteByName(user *models.User, gender bool) (int64, error)
DeleteByAgeAndCret(user *models.User) (int64, *models.User, error)
DeleteXByAge(age int, URL string) (int64, models.User, error)
// sql:delete "user" where id=:id and age in :ages
DeleteName(user *models.User, name string, ages []int) (int64, error)
// sql:delete user where id = :id and age>:age
DeleteXName(user *models.User, name string) (int64, error)
DeleteAll() (int64, models.User, error)
// sql:where id=:id
Delete1Name(id uint64) (int64, models.User, error)
// sql:where id=:id
Delete2Name(user models.User, id uint64) (int64, error)
}
type Find ¶
type Find interface {
// sql: select id as id, name name, sum(age) as Age where id=:id group by name
FindA(ctx context.Context, id uint64) (*models.User, error)
FindById(id uint64) (models.User, error)
// sql: select * from user where name like :nm order by id
FindUsers(nm string, from, size int, limit rt.Limit) ([]*models.User, error)
// sql: order by name
FindUsers2(nm string) ([]*models.User, error)
// sql: select * from user where id in :ids
FindUsers1(ids []uint64) ([]*models.User, error)
FindMapByName(name string, kg func(*models.User) (uint64, error)) (map[uint64]*models.User, error)
FindCbById(id uint64, fn func(*models.User) error) error
FindMapById(id uint64, fn func(*models.User) (uint64, error)) (map[uint64]*models.User, error)
}
type FindBy ¶
type FindBy interface {
FindAById(ctx context.Context, id uint64) (*models.User, error)
FindById(id uint64) (models.User, error)
FindXuByName(name string) ([]*models.User, error)
FindMapByName(name string, kg func(*models.User) (uint64, error)) (map[uint64]*models.User, error)
FindCbById(id uint64, fn func(*models.User) error) error
}
type RepoTruncate ¶
type Repository ¶
type Repository interface {
Count() Count
Delete() Delete
Find() Find
FindBy() FindBy
UserRepo() UserRepo
Teacher() Teacher
RepoTruncate() RepoTruncate
Update() Update
GetProvider() *rt.Provider
Transaction(fn func() error) error
}
func GetRepository ¶
func GetRepository(p *rt.Provider, dialect ...string) Repository
type Update ¶
type Update interface {
UpdateXuByIdAndAge(user *models.User) error
FindByID(ID int64) (*Abc, error)
UpdateByName(user *models.User, gender bool) (int64, error)
UpdateByAgeAndCret(user *models.User) (int64, *models.User, error)
UpdateXByAge(age int, URL string) (int64, models.User, error)
// sql:update "user" set "name"=:name,url=:URL,cret=:cret where id=:id and age>:age
UpdateName(user *models.User, name string) (int64, error)
// sql:update user where id=:id and age>:age
UpdateXName(user *models.User, name string) (int64, error)
UpdateYName(name string) (int64, models.User, error)
// sql:where id=:id
Update1Name(name string, id uint64) (int64, models.User, error)
// sql:where id in :ids or name=:name
Update2Name(user models.User, ids []uint64) (int64, error)
}
type UserRepo ¶
type UserRepo interface {
Insert(ctx context.Context, user *models.User, name string) (*models.User, error)
InsertA(user *models.User) error
InsertB(user *models.User, name, URL string) (models.User, error)
InsertC(user *models.User) (*models.User, error)
InsertUser(name string) (*models.User, error)
}
Source Files
¶
Directories
¶
| Path | Synopsis |
|---|---|
|
+gpa-ignore DO NOT EDIT THIS FILE Generated by mro at 2022-04-12 16:29:08 +gpa-ignore DO NOT EDIT THIS FILE Generated by mro at 2022-04-12 16:29:08 +gpa-ignore DO NOT EDIT THIS FILE Generated by gpa at 2022-04-12 16:29:10 +gpa-ignore DO NOT EDIT THIS FILE Generated by mro at 2022-04-12 16:29:09 +gpa-ignore DO NOT EDIT THIS FILE Generated by mro at 2022-04-12 16:29:09 +gpa-ignore DO NOT EDIT THIS FILE Generated by gpa at 2022-04-12 16:29:10 +gpa-ignore DO NOT EDIT THIS FILE Generated by mro at 2022-04-12 16:29:09 +gpa-ignore DO NOT EDIT THIS FILE Generated by mro at 2022-04-12 16:29:09 +gpa-ignore DO NOT EDIT THIS FILE Generated by mro at 2022-04-12 16:29:09 +gpa-ignore DO NOT EDIT THIS FILE Generated by mro at 2022-04-12 16:29:10
|
+gpa-ignore DO NOT EDIT THIS FILE Generated by mro at 2022-04-12 16:29:08 +gpa-ignore DO NOT EDIT THIS FILE Generated by mro at 2022-04-12 16:29:08 +gpa-ignore DO NOT EDIT THIS FILE Generated by gpa at 2022-04-12 16:29:10 +gpa-ignore DO NOT EDIT THIS FILE Generated by mro at 2022-04-12 16:29:09 +gpa-ignore DO NOT EDIT THIS FILE Generated by mro at 2022-04-12 16:29:09 +gpa-ignore DO NOT EDIT THIS FILE Generated by gpa at 2022-04-12 16:29:10 +gpa-ignore DO NOT EDIT THIS FILE Generated by mro at 2022-04-12 16:29:09 +gpa-ignore DO NOT EDIT THIS FILE Generated by mro at 2022-04-12 16:29:09 +gpa-ignore DO NOT EDIT THIS FILE Generated by mro at 2022-04-12 16:29:09 +gpa-ignore DO NOT EDIT THIS FILE Generated by mro at 2022-04-12 16:29:10 |
Click to show internal directories.
Click to hide internal directories.