Documentation
¶
Overview ¶
Package users demonstrates how to extend sqlcredo with custom SQL queries. It provides a complete example of a user repository that includes standard CRUD operations and a custom query method for counting users based on whether they have a last name.
Index ¶
- Constants
- type Article
- type ArticlesRepo
- type CountByLastNameExistsCategory
- type Identity
- type Repo
- func (r *Repo) Articles() *ArticlesRepo
- func (r *Repo) CountByLastNameExists(ctx context.Context) (map[string]int, error)
- func (r *Repo) CreateWithArticle(ctx context.Context, user *User, article *Article) error
- func (r *Repo) DeleteWithArticles(ctx context.Context, id Identity) error
- func (r *Repo) GetWithArticles(ctx context.Context, dest *User, id Identity) error
- func (r *Repo) WithTxx(txExec sc.SQLExecutor) *Repo
- type User
Constants ¶
View Source
const ( TableName = "users" IDColumn = "id" )
View Source
const CountByLastNameExistsQuery = `` /* 191-byte string literal not displayed */
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ArticlesRepo ¶ added in v0.9.0
func NewArticlesRepo ¶ added in v0.9.0
func (*ArticlesRepo) DeleteByUserID ¶ added in v0.9.0
func (*ArticlesRepo) GetByUserID ¶ added in v0.9.0
func (*ArticlesRepo) WithTxx ¶ added in v0.9.0
func (r *ArticlesRepo) WithTxx(txExec sc.SQLExecutor) *ArticlesRepo
type Repo ¶
func (*Repo) Articles ¶ added in v0.9.0
func (r *Repo) Articles() *ArticlesRepo
func (*Repo) CountByLastNameExists ¶
func (*Repo) CreateWithArticle ¶ added in v0.9.0
func (*Repo) DeleteWithArticles ¶ added in v0.9.0
func (*Repo) GetWithArticles ¶ added in v0.9.0
Click to show internal directories.
Click to hide internal directories.