Documentation ¶
Overview ¶
Package database General database for CRUD operation
Index ¶
- func Create(db *gorm.DB, model interface{}) error
- func DB() *gorm.DB
- func DBErr() error
- func Delete(db *gorm.DB, condition, model interface{}) (count int, err error)
- func Find(db *gorm.DB, condition, model interface{}, associations []string) (isEmpty bool, err error)
- func First(db *gorm.DB, condition, model interface{}, associations []string) (isNotFound bool, err error)
- func Save(db *gorm.DB, model interface{}) error
- func Setup() error
- func Update(db *gorm.DB, condition, model interface{}) error
- type Database
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Delete ¶
Delete will delete record(s) from model with given condition it will returning 'count' of affected record and error status
func Find ¶
func Find(db *gorm.DB, condition, model interface{}, associations []string) ( isEmpty bool, err error)
Find will get model and its associations records based on given condition
func First ¶
func First(db *gorm.DB, condition, model interface{}, associations []string) ( isNotFound bool, err error)
First will fetch model and its associations based on given condition
Types ¶
Click to show internal directories.
Click to hide internal directories.