Documentation ¶
Index ¶
- func Delete[T any](q *Query[T]) *gorm.DB
- func DeleteById[T any](id any) *gorm.DB
- func DeleteByIds[T any](ids any) *gorm.DB
- func Init(db *gorm.DB)
- func Insert[T any](entity *T) *gorm.DB
- func InsertBatch[T any](entities []*T) *gorm.DB
- func InsertBatchSize[T any](entities []*T, batchSize int) *gorm.DB
- func SelectById[T any](id any) (*T, *gorm.DB)
- func SelectByIds[T any](ids any) ([]*T, *gorm.DB)
- func SelectCount[T any](q *Query[T]) (int64, *gorm.DB)
- func SelectList[T any](q *Query[T]) ([]*T, *gorm.DB)
- func SelectListModel[T any, R any](q *Query[T]) ([]*R, *gorm.DB)
- func SelectOne[T any](q *Query[T]) (*T, *gorm.DB)
- func Update[T any](q *Query[T]) *gorm.DB
- func UpdateById[T any](entity *T, id any) *gorm.DB
- type CommonDao
- func (service CommonDao[T]) Count(q *Query[T]) (int64, *gorm.DB)
- func (service CommonDao[T]) CountAll() (int64, *gorm.DB)
- func (service CommonDao[T]) Db() *gorm.DB
- func (service CommonDao[T]) GetById(id any) (*T, *gorm.DB)
- func (service CommonDao[T]) GetOne(q *Query[T]) (*T, *gorm.DB)
- func (service CommonDao[T]) List(q *Query[T]) ([]*T, *gorm.DB)
- func (service CommonDao[T]) ListAll() ([]*T, *gorm.DB)
- func (service CommonDao[T]) ListByIds(ids []any) ([]*T, *gorm.DB)
- func (service CommonDao[T]) Page(page *Page[T], q *Query[T]) (*Page[T], *gorm.DB)
- func (service CommonDao[T]) PageAll(page *Page[T]) (*Page[T], *gorm.DB)
- func (service CommonDao[T]) Remove(q *Query[T]) *gorm.DB
- func (service CommonDao[T]) RemoveById(id any) *gorm.DB
- func (service CommonDao[T]) RemoveByIds(ids []any) *gorm.DB
- func (service CommonDao[T]) Save(entity *T) *gorm.DB
- func (service CommonDao[T]) SaveBatch(entities []*T) *gorm.DB
- func (service CommonDao[T]) SaveBatchSize(entities []*T, batchSize int) *gorm.DB
- func (service CommonDao[T]) Update(q *Query[T]) *gorm.DB
- func (service CommonDao[T]) UpdateById(entity *T, id any) *gorm.DB
- type Page
- type Query
- func (q *Query[T]) And() *Query[T]
- func (q *Query[T]) AndBracket(bracketQuery *Query[T]) *Query[T]
- func (q *Query[T]) Between(column string, start, end any) *Query[T]
- func (q *Query[T]) Distinct(column ...string) *Query[T]
- func (q *Query[T]) Eq(column string, val any) *Query[T]
- func (q *Query[T]) Ge(column string, val any) *Query[T]
- func (q *Query[T]) Group(columns ...string) *Query[T]
- func (q *Query[T]) Gt(column string, val any) *Query[T]
- func (q *Query[T]) Having(having string, args ...any) *Query[T]
- func (q *Query[T]) In(column string, val any) *Query[T]
- func (q *Query[T]) IsNotNull(column string) *Query[T]
- func (q *Query[T]) IsNull(column string) *Query[T]
- func (q *Query[T]) Le(column string, val any) *Query[T]
- func (q *Query[T]) Like(column string, val any) *Query[T]
- func (q *Query[T]) LikeLeft(column string, val any) *Query[T]
- func (q *Query[T]) LikeRight(column string, val any) *Query[T]
- func (q *Query[T]) Lt(column string, val any) *Query[T]
- func (q *Query[T]) Ne(column string, val any) *Query[T]
- func (q *Query[T]) NotBetween(column string, start, end any) *Query[T]
- func (q *Query[T]) NotIn(column string, val any) *Query[T]
- func (q *Query[T]) NotLike(column string, val any) *Query[T]
- func (q *Query[T]) Or() *Query[T]
- func (q *Query[T]) OrBracket(bracketQuery *Query[T]) *Query[T]
- func (q *Query[T]) OrderByAsc(columns ...string) *Query[T]
- func (q *Query[T]) OrderByDesc(columns ...string) *Query[T]
- func (q *Query[T]) Select(columns ...string) *Query[T]
- func (q *Query[T]) Set(column string, val any) *Query[T]
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func InsertBatch ¶
Types ¶
type CommonDao ¶
type CommonDao[T any] struct{}
func NewCommonDao ¶ added in v0.0.10
func (CommonDao[T]) SaveBatchSize ¶
type Query ¶
type Query[T any] struct { SelectColumns []string DistinctColumns []string QueryBuilder strings.Builder OrBracketBuilder strings.Builder OrBracketArgs []any AndBracketBuilder strings.Builder AndBracketArgs []any QueryArgs []any OrderBuilder strings.Builder GroupBuilder strings.Builder HavingBuilder strings.Builder HavingArgs []any LastCond string UpdateMap map[string]any }
func (*Query[T]) AndBracket ¶
func (*Query[T]) NotBetween ¶
func (*Query[T]) OrderByAsc ¶
func (*Query[T]) OrderByDesc ¶
Click to show internal directories.
Click to hide internal directories.