postgresql

package
v0.0.0-...-5bcfc9d Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Mar 1, 2025 License: Apache-2.0 Imports: 15 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ConnectToDatabase

func ConnectToDatabase(logger *utility.Logger, configDatabases config.Database) *gorm.DB

func GetPagination

func GetPagination(c *gin.Context) database.Pagination

Types

type Postgresql

type Postgresql struct {
	Db *gorm.DB
}

func NewPostgresqlConnection

func NewPostgresqlConnection(db *gorm.DB) *Postgresql

func (*Postgresql) CheckExists

func (p *Postgresql) CheckExists(receiver interface{}, query interface{}, args ...interface{}) bool

func (*Postgresql) CheckExistsInTable

func (p *Postgresql) CheckExistsInTable(table string, query interface{}, args ...interface{}) bool

func (*Postgresql) CheckExistsInTable1

func (p *Postgresql) CheckExistsInTable1(table string, query interface{}, args ...interface{}) bool

func (*Postgresql) CountRecords

func (p *Postgresql) CountRecords(model interface{}) (int64, error)

func (*Postgresql) CountSpecificRecords

func (p *Postgresql) CountSpecificRecords(model interface{}, query interface{}) (int64, error)

func (*Postgresql) CreateMultipleRecords

func (p *Postgresql) CreateMultipleRecords(model interface{}, length int) error

func (*Postgresql) CreateOneRecord

func (p *Postgresql) CreateOneRecord(model interface{}) error

func (*Postgresql) DB

func (p *Postgresql) DB() *gorm.DB

func (*Postgresql) DeleteRecordFromDb

func (p *Postgresql) DeleteRecordFromDb(record interface{}) error

func (*Postgresql) HardDeleteRecordFromDb

func (p *Postgresql) HardDeleteRecordFromDb(record interface{}) error

func (*Postgresql) PreloadEntities

func (p *Postgresql) PreloadEntities(db *gorm.DB, model interface{}, preloads ...string) *gorm.DB

func (*Postgresql) RawSelectAllFromByGroup

func (p *Postgresql) RawSelectAllFromByGroup(orderBy, order string, pagination *database.Pagination, model interface{}, receiver interface{}, groupColumn string, selectQuery string, query string, args ...interface{}) (database.PaginationResponse, error)

func (*Postgresql) SaveAllFields

func (p *Postgresql) SaveAllFields(model interface{}) (*gorm.DB, error)

func (*Postgresql) SaveAllModelsFields

func (p *Postgresql) SaveAllModelsFields(models []interface{}) (*gorm.DB, error)

func (*Postgresql) SelectAllFromByGroup

func (p *Postgresql) SelectAllFromByGroup(orderBy, order string, pagination *database.Pagination, receiver interface{}, query interface{}, groupColumn string, args ...interface{}) (database.PaginationResponse, error)

func (*Postgresql) SelectAllFromDb

func (p *Postgresql) SelectAllFromDb(order string, preload string, receiver interface{}, query interface{}, args ...interface{}) error

func (*Postgresql) SelectAllFromDbOrderBy

func (p *Postgresql) SelectAllFromDbOrderBy(orderBy, order string, receiver interface{}, query interface{}, args ...interface{}) error

func (*Postgresql) SelectAllFromDbOrderByPaginated

func (p *Postgresql) SelectAllFromDbOrderByPaginated(orderBy, order, filter string, pagination database.Pagination, receiver interface{}, query interface{}, args ...interface{}) (database.PaginationResponse, error)

func (*Postgresql) SelectAllFromDbWithLimit

func (p *Postgresql) SelectAllFromDbWithLimit(order string, limit int, receiver interface{}, query interface{}, args ...interface{}) error

func (*Postgresql) SelectFirstFromDb

func (p *Postgresql) SelectFirstFromDb(receiver interface{}) error

func (*Postgresql) SelectLatestFromDb

func (p *Postgresql) SelectLatestFromDb(receiver interface{}, query interface{}, args ...interface{}) (error, error)

func (*Postgresql) SelectOneFromDb

func (p *Postgresql) SelectOneFromDb(receiver interface{}, query interface{}, args ...interface{}) (error, error)

func (*Postgresql) SelectRandomFromDb

func (p *Postgresql) SelectRandomFromDb(receiver interface{}, query interface{}, args ...interface{}) (error, error)

func (*Postgresql) UpdateFields

func (p *Postgresql) UpdateFields(model interface{}, updates interface{}, id string) (*gorm.DB, error)

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL