postgres

package
v0.0.0-...-b5ce554 Latest Latest
Warning

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

Go to latest
Published: Nov 15, 2022 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type PostgresRepository

type PostgresRepository struct {
	// contains filtered or unexported fields
}

func (*PostgresRepository) Begin

func (r *PostgresRepository) Begin() *gorm.DB

func (*PostgresRepository) Commit

func (r *PostgresRepository) Commit(db *gorm.DB) *gorm.DB

func (*PostgresRepository) Create

func (r *PostgresRepository) Create(ent interface{}) error

func (*PostgresRepository) CreateTransaction

func (r *PostgresRepository) CreateTransaction(db *gorm.DB, ent interface{}) error

func (*PostgresRepository) Delete

func (r *PostgresRepository) Delete(filters map[string]interface{}, ent interface{}) error

new implement Delete

func (*PostgresRepository) Find

func (r *PostgresRepository) Find(filters map[string]interface{}, ent interface{}) error

func (*PostgresRepository) First

func (r *PostgresRepository) First(filters map[string]interface{}, ent interface{}) error

func (*PostgresRepository) IsErrorRecordNotFound

func (r *PostgresRepository) IsErrorRecordNotFound(err error) bool

func (*PostgresRepository) Last

func (r *PostgresRepository) Last(filters map[string]interface{}, ent interface{}) error

func (*PostgresRepository) List

func (r *PostgresRepository) List(tableName string, offset, limit int64, filters, order, ent interface{}) (*utils.Pagination, error)

func (*PostgresRepository) Raw

func (r *PostgresRepository) Raw(ent interface{}, sql string, value ...interface{}) error

func (*PostgresRepository) Rollback

func (r *PostgresRepository) Rollback(db *gorm.DB) *gorm.DB

func (*PostgresRepository) RollbackTo

func (r *PostgresRepository) RollbackTo(db *gorm.DB, input string) *gorm.DB

func (*PostgresRepository) SavePoint

func (r *PostgresRepository) SavePoint(db *gorm.DB, input string) *gorm.DB

func (*PostgresRepository) Update

func (r *PostgresRepository) Update(filters map[string]interface{}, ent interface{}) error

func (*PostgresRepository) UpdateTransaction

func (r *PostgresRepository) UpdateTransaction(db *gorm.DB, filters map[string]interface{}, ent interface{}) error

func (*PostgresRepository) Upsert

func (r *PostgresRepository) Upsert(tableName string, filters map[string]interface{}, ent interface{}) error

type Repository

type Repository interface {
	Raw(ent interface{}, sql string, value ...interface{}) (err error)
	Create(ent interface{}) (err error)
	Find(filters map[string]interface{}, ent interface{}) error
	First(filters map[string]interface{}, ent interface{}) error
	Last(filters map[string]interface{}, ent interface{}) error
	List(tableName string, offset, limit int64, filters, order, ent interface{}) (*utils.Pagination, error)
	Update(filters map[string]interface{}, ent interface{}) error
	// new implement delete
	Delete(filters map[string]interface{}, ent interface{}) error
	Begin() *gorm.DB
	Commit(db *gorm.DB) *gorm.DB
	Rollback(db *gorm.DB) *gorm.DB
	SavePoint(db *gorm.DB, input string) *gorm.DB
	RollbackTo(db *gorm.DB, input string) *gorm.DB
	CreateTransaction(db *gorm.DB, ent interface{}) error
	UpdateTransaction(db *gorm.DB, filters map[string]interface{}, ent interface{}) error
	IsErrorRecordNotFound(err error) bool
	Upsert(tableName string, filters map[string]interface{}, ent interface{}) error
}

func NewRepository

func NewRepository(db *database.DB) Repository

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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