Documentation
¶
Index ¶
Constants ¶
View Source
const ( // POSTGRES represents PostgresSQL POSTGRES = "postgres" // MYSQL represents MySQL MYSQL = "mysql" // SQLITE represents SQLite3 SQLITE = "sqlite3" )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Repository ¶
type Repository interface {
Model(value any) *gorm.DB
Select(query any, args ...any) *gorm.DB
Find(out any, where ...any) *gorm.DB
Exec(sql string, values ...any) *gorm.DB
First(out any, where ...any) *gorm.DB
Raw(sql string, values ...any) *gorm.DB
Create(value any) *gorm.DB
Save(value any) *gorm.DB
Updates(value any) *gorm.DB
Delete(value any) *gorm.DB
Where(query any, args ...any) *gorm.DB
Preload(column string, conditions ...any) *gorm.DB
Association(column string) *gorm.Association
Close() error
AutoMigrate(dst ...any) error
GetDB() *gorm.DB
}
Repository defines a interface for access the database.
func NewRepository ¶
func NewRepository(l logger.Logger, conf *config.Configuration) (Repository, error)
NewRepository is constructor for bookRepository.
Click to show internal directories.
Click to hide internal directories.