Documentation
¶
Index ¶
- func CheckExists(db *gorm.DB, receiver interface{}, query interface{}, args ...interface{}) bool
- func CheckExistsInTable(db *gorm.DB, table string, query interface{}, args ...interface{}) bool
- func CheckExistsInTable1(db *gorm.DB, table string, query interface{}, args ...interface{}) bool
- func ConnectToDatabase(logger *utility.Logger, configDatabases config.Database) *gorm.DB
- func CountRecords(db *gorm.DB, model interface{}) (int64, error)
- func CountSpecificRecords(db *gorm.DB, model interface{}, query interface{}) (int64, error)
- func CreateMultipleRecords(db *gorm.DB, model interface{}, length int) error
- func CreateOneRecord(db *gorm.DB, model interface{}) error
- func DeleteRecordFromDb(db *gorm.DB, record interface{}) error
- func HardDeleteRecordFromDb(db *gorm.DB, record interface{}) error
- func PreloadEntities(db *gorm.DB, model interface{}, preloads ...string) *gorm.DB
- func SaveAllFields(db *gorm.DB, model interface{}) (*gorm.DB, error)
- func SaveAllModelsFields(db *gorm.DB, models []interface{}) (*gorm.DB, error)
- func SelectAllFromDb(db *gorm.DB, order string, receiver interface{}, query interface{}, ...) error
- func SelectAllFromDbOrderBy(db *gorm.DB, orderBy, order string, receiver interface{}, query interface{}, ...) error
- func SelectAllFromDbWithLimit(db *gorm.DB, order string, limit int, receiver interface{}, query interface{}, ...) error
- func SelectFirstFromDb(db *gorm.DB, receiver interface{}) error
- func SelectLatestFromDb(db *gorm.DB, receiver interface{}, query interface{}, args ...interface{}) (error, error)
- func SelectOneFromDb(db *gorm.DB, receiver interface{}, query interface{}, args ...interface{}) (error, error)
- func SelectRandomFromDb(db *gorm.DB, receiver interface{}, query interface{}, args ...interface{}) (error, error)
- func UpdateFields(db *gorm.DB, model interface{}, updates interface{}, id string) (*gorm.DB, error)
- type Pagination
- type PaginationResponse
- func RawSelectAllFromByGroup(db *gorm.DB, orderBy, order string, pagination *Pagination, model interface{}, ...) (PaginationResponse, error)
- func SelectAllFromByGroup(db *gorm.DB, orderBy, order string, pagination *Pagination, ...) (PaginationResponse, error)
- func SelectAllFromDbOrderByPaginated(db *gorm.DB, orderBy, order string, pagination Pagination, ...) (PaginationResponse, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CheckExists ¶
func CheckExistsInTable ¶
func CheckExistsInTable1 ¶
func ConnectToDatabase ¶
func CountSpecificRecords ¶
func CreateMultipleRecords ¶
func CreateOneRecord ¶
func DeleteRecordFromDb ¶
func HardDeleteRecordFromDb ¶
func PreloadEntities ¶
func SaveAllModelsFields ¶
func SelectAllFromDb ¶
func SelectAllFromDbOrderBy ¶
func SelectFirstFromDb ¶
func SelectLatestFromDb ¶
func SelectOneFromDb ¶
func SelectRandomFromDb ¶
Types ¶
type Pagination ¶
func GetPagination ¶
func GetPagination(c *gin.Context) Pagination
type PaginationResponse ¶
type PaginationResponse struct { CurrentPage int `json:"current_page"` PageCount int `json:"page_count"` TotalPagesCount int `json:"total_pages_count"` }
func RawSelectAllFromByGroup ¶
func RawSelectAllFromByGroup(db *gorm.DB, orderBy, order string, pagination *Pagination, model interface{}, receiver interface{}, groupColumn string, selectQuery string, query string, args ...interface{}) (PaginationResponse, error)
func SelectAllFromByGroup ¶
func SelectAllFromByGroup(db *gorm.DB, orderBy, order string, pagination *Pagination, receiver interface{}, query interface{}, groupColumn string, args ...interface{}) (PaginationResponse, error)
func SelectAllFromDbOrderByPaginated ¶
func SelectAllFromDbOrderByPaginated(db *gorm.DB, orderBy, order string, pagination Pagination, receiver interface{}, query interface{}, args ...interface{}) (PaginationResponse, error)
Click to show internal directories.
Click to hide internal directories.