db

package
v1.7.0 Latest Latest
Warning

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

Go to latest
Published: Oct 22, 2024 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrUniqueConstraintViolation = errors.New("unique constraint violation")

Functions

func NewDatabaseConnection

func NewDatabaseConnection(dsn string) (*gorm.DB, error)

func TranslateError

func TranslateError(err error, db *gorm.DB) error

Types

type BaseRepository

type BaseRepository struct {
	Tables []TableI
	// contains filtered or unexported fields
}

func NewBaseRepository

func NewBaseRepository(db *gorm.DB, tables []TableI) *BaseRepository

func (*BaseRepository) CreateIndexes

func (r *BaseRepository) CreateIndexes(ctx context.Context) error

nolint:revive

func (*BaseRepository) Init

func (r *BaseRepository) Init(ctx context.Context) error

type TableI

type TableI interface {
	TableName() string
}

Jump to

Keyboard shortcuts

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