Documentation ¶
Index ¶
- Variables
- type Book
- type BookRepo
- type BookRepoImpl
- func (r *BookRepoImpl) BulkInsert(ctx context.Context, ents ...*Book) (int64, error)
- func (r *BookRepoImpl) Count(ctx context.Context, opts ...sqkit.SelectOption) (int64, error)
- func (r *BookRepoImpl) Delete(ctx context.Context, opts ...sqkit.DeleteOption) (int64, error)
- func (r *BookRepoImpl) Find(ctx context.Context, opts ...sqkit.SelectOption) (list []*Book, err error)
- func (r *BookRepoImpl) Insert(ctx context.Context, ent *Book) (int64, error)
- func (r *BookRepoImpl) Patch(ctx context.Context, ent *Book, opts ...sqkit.UpdateOption) (int64, error)
- func (r *BookRepoImpl) Update(ctx context.Context, ent *Book, opts ...sqkit.UpdateOption) (int64, error)
Constants ¶
This section is empty.
Variables ¶
Functions ¶
This section is empty.
Types ¶
type Book ¶
type Book struct { ID int64 `column:"id" option:"pk" json:"id"` Title string `column:"title" json:"title"` Author string `column:"author" json:"author"` UpdatedAt time.Time `column:"updated_at" option:"now" json:"update_at"` CreatedAt time.Time `column:"created_at" option:"now,no_update" json:"created_at"` }
type BookRepo ¶
type BookRepo interface { Count(context.Context, ...sqkit.SelectOption) (int64, error) Find(context.Context, ...sqkit.SelectOption) ([]*Book, error) Insert(context.Context, *Book) (int64, error) BulkInsert(context.Context, ...*Book) (int64, error) Delete(context.Context, ...sqkit.DeleteOption) (int64, error) Update(context.Context, *Book, ...sqkit.UpdateOption) (int64, error) Patch(context.Context, *Book, ...sqkit.UpdateOption) (int64, error) }
@mock
type BookRepoImpl ¶
func (*BookRepoImpl) BulkInsert ¶
BulkInsert books and return affected rows
func (*BookRepoImpl) Count ¶
func (r *BookRepoImpl) Count(ctx context.Context, opts ...sqkit.SelectOption) (int64, error)
Count books
func (*BookRepoImpl) Delete ¶
func (r *BookRepoImpl) Delete(ctx context.Context, opts ...sqkit.DeleteOption) (int64, error)
Delete books
func (*BookRepoImpl) Find ¶
func (r *BookRepoImpl) Find(ctx context.Context, opts ...sqkit.SelectOption) (list []*Book, err error)
Find books
func (*BookRepoImpl) Patch ¶
func (r *BookRepoImpl) Patch(ctx context.Context, ent *Book, opts ...sqkit.UpdateOption) (int64, error)
Patch books
func (*BookRepoImpl) Update ¶
func (r *BookRepoImpl) Update(ctx context.Context, ent *Book, opts ...sqkit.UpdateOption) (int64, error)
Update books
Click to show internal directories.
Click to hide internal directories.