Documentation ¶
Index ¶
- type PostgresRepository
- func (r *PostgresRepository) Begin() *gorm.DB
- func (r *PostgresRepository) Commit(db *gorm.DB) *gorm.DB
- func (r *PostgresRepository) Create(ent interface{}) error
- func (r *PostgresRepository) CreateTransaction(db *gorm.DB, ent interface{}) error
- func (r *PostgresRepository) Delete(filters map[string]interface{}, ent interface{}) error
- func (r *PostgresRepository) Find(filters map[string]interface{}, ent interface{}) error
- func (r *PostgresRepository) First(filters map[string]interface{}, ent interface{}) error
- func (r *PostgresRepository) IsErrorRecordNotFound(err error) bool
- func (r *PostgresRepository) Last(filters map[string]interface{}, ent interface{}) error
- func (r *PostgresRepository) List(tableName string, offset, limit int64, filters, order, ent interface{}) (*utils.Pagination, error)
- func (r *PostgresRepository) Raw(ent interface{}, sql string, value ...interface{}) error
- func (r *PostgresRepository) Rollback(db *gorm.DB) *gorm.DB
- func (r *PostgresRepository) RollbackTo(db *gorm.DB, input string) *gorm.DB
- func (r *PostgresRepository) SavePoint(db *gorm.DB, input string) *gorm.DB
- func (r *PostgresRepository) Update(filters map[string]interface{}, ent interface{}) error
- func (r *PostgresRepository) UpdateTransaction(db *gorm.DB, filters map[string]interface{}, ent interface{}) error
- func (r *PostgresRepository) Upsert(tableName string, filters map[string]interface{}, ent interface{}) error
- type Repository
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) 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) RollbackTo ¶
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
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
Click to show internal directories.
Click to hide internal directories.