Documentation
¶
Index ¶
- type Delete
- type DeleteWheres
- type EntryModel
- func (a *EntryModel[T]) CreateTable() error
- func (a *EntryModel[T]) Delete() *Delete[T]
- func (a *EntryModel[T]) DeleteOne(id uint) error
- func (a *EntryModel[T]) DeleteTable() error
- func (a *EntryModel[T]) FindAll() ([]T, error)
- func (a *EntryModel[T]) FindAllByIds(id ...uint) ([]T, error)
- func (a *EntryModel[T]) FindById(id uint) (T, error)
- func (a *EntryModel[T]) FindOne(query interface{}, args ...interface{}) (T, error)
- func (a *EntryModel[T]) GetTableName() string
- func (a *EntryModel[T]) IsExist() bool
- func (a *EntryModel[T]) NewEntryModel(db *gorm.DB) *EntryModel[T]
- func (a *EntryModel[T]) Page(page *web.Page) ([]T, int, error)
- func (a *EntryModel[T]) Query() *Query[T]
- func (a *EntryModel[T]) QueryPage(page *web.Page, query interface{}, args ...interface{}) ([]T, int, error)
- func (a *EntryModel[T]) Save(t T) error
- func (a *EntryModel[T]) Saves(ts []T) error
- func (a *EntryModel[T]) Update() *Update[T]
- func (a *EntryModel[T]) UpdateById(t T) error
- func (a *EntryModel[T]) UpdateColumn(id uint, column string, value interface{}) error
- func (a *EntryModel[T]) UpdateForMap(id uint, data map[string]interface{}) error
- type IEntry
- type Model
- func (a *Model[T]) CreateTable() error
- func (a *Model[T]) Delete() *Delete[T]
- func (a *Model[T]) DeleteTable() error
- func (a *Model[T]) GetTableName() string
- func (a *Model[T]) IsExist() bool
- func (a *Model[T]) Query() *Query[T]
- func (a *Model[T]) Save(entry T) error
- func (a *Model[T]) Saves(entry []T) error
- func (a *Model[T]) Update() *Update[T]
- type Page
- type Query
- func (q *Query[T]) All() ([]T, error)
- func (q *Query[T]) List(size int) ([]T, error)
- func (q *Query[T]) ListPage(page *web.Page) ([]T, error)
- func (q *Query[T]) One() (T, error)
- func (q *Query[T]) Order(query interface{}) *Query[T]
- func (q *Query[T]) Page(page *web.Page) ([]T, int, error)
- func (q *Query[T]) Size(size int) ([]T, int, error)
- func (q *Query[T]) Where(query interface{}, args ...interface{}) *Query[T]
- type Transaction
- type Update
- type UpdateWheres
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type DeleteWheres ¶
type DeleteWheres[T any] struct { // contains filtered or unexported fields }
func NewDeleteWheres ¶
func NewDeleteWheres[T any](tx *gorm.DB, entry T) *DeleteWheres[T]
func (*DeleteWheres[T]) Delete ¶
func (w *DeleteWheres[T]) Delete() error
func (*DeleteWheres[T]) Where ¶
func (w *DeleteWheres[T]) Where(query interface{}, args ...interface{}) *DeleteWheres[T]
type EntryModel ¶
type EntryModel[T IEntry] struct { // contains filtered or unexported fields }
func NewEntryModel ¶
func NewEntryModel[T IEntry](db *gorm.DB, tableName string) *EntryModel[T]
func (*EntryModel[T]) CreateTable ¶
func (a *EntryModel[T]) CreateTable() error
func (*EntryModel[T]) Delete ¶
func (a *EntryModel[T]) Delete() *Delete[T]
func (*EntryModel[T]) DeleteOne ¶
func (a *EntryModel[T]) DeleteOne(id uint) error
func (*EntryModel[T]) DeleteTable ¶
func (a *EntryModel[T]) DeleteTable() error
func (*EntryModel[T]) FindAll ¶
func (a *EntryModel[T]) FindAll() ([]T, error)
func (*EntryModel[T]) FindAllByIds ¶
func (a *EntryModel[T]) FindAllByIds(id ...uint) ([]T, error)
func (*EntryModel[T]) FindById ¶
func (a *EntryModel[T]) FindById(id uint) (T, error)
func (*EntryModel[T]) FindOne ¶
func (a *EntryModel[T]) FindOne(query interface{}, args ...interface{}) (T, error)
func (*EntryModel[T]) GetTableName ¶
func (a *EntryModel[T]) GetTableName() string
func (*EntryModel[T]) IsExist ¶
func (a *EntryModel[T]) IsExist() bool
func (*EntryModel[T]) NewEntryModel ¶
func (a *EntryModel[T]) NewEntryModel(db *gorm.DB) *EntryModel[T]
func (*EntryModel[T]) Query ¶
func (a *EntryModel[T]) Query() *Query[T]
func (*EntryModel[T]) QueryPage ¶
func (a *EntryModel[T]) QueryPage(page *web.Page, query interface{}, args ...interface{}) ([]T, int, error)
func (*EntryModel[T]) Save ¶
func (a *EntryModel[T]) Save(t T) error
func (*EntryModel[T]) Saves ¶
func (a *EntryModel[T]) Saves(ts []T) error
func (*EntryModel[T]) Update ¶
func (a *EntryModel[T]) Update() *Update[T]
func (*EntryModel[T]) UpdateById ¶
func (a *EntryModel[T]) UpdateById(t T) error
func (*EntryModel[T]) UpdateColumn ¶
func (a *EntryModel[T]) UpdateColumn(id uint, column string, value interface{}) error
func (*EntryModel[T]) UpdateForMap ¶
func (a *EntryModel[T]) UpdateForMap(id uint, data map[string]interface{}) error
type Model ¶
type Model[T any] struct { // contains filtered or unexported fields }
func (*Model[T]) CreateTable ¶
func (*Model[T]) DeleteTable ¶
func (*Model[T]) GetTableName ¶
type Transaction ¶
type Transaction struct {
// contains filtered or unexported fields
}
func NewTransaction ¶
func NewTransaction(db *gorm.DB) *Transaction
type UpdateWheres ¶
type UpdateWheres[T any] struct { // contains filtered or unexported fields }
func NewUpdateWheres ¶
func NewUpdateWheres[T any](tx *gorm.DB) *UpdateWheres[T]
func (*UpdateWheres[T]) Update ¶
func (w *UpdateWheres[T]) Update(t T) error
func (*UpdateWheres[T]) UpdateColumn ¶
func (w *UpdateWheres[T]) UpdateColumn(column string, value any) error
func (*UpdateWheres[T]) UpdateForMap ¶
func (w *UpdateWheres[T]) UpdateForMap(mapValue map[string]any) error
func (*UpdateWheres[T]) Where ¶
func (w *UpdateWheres[T]) Where(query interface{}, args ...interface{}) *UpdateWheres[T]
Click to show internal directories.
Click to hide internal directories.