repository

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Jul 31, 2023 License: Apache-2.0 Imports: 7 Imported by: 0

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.

Jump to

Keyboard shortcuts

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