orm

package
v0.0.0-...-546bc1b Latest Latest
Warning

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

Go to latest
Published: Sep 3, 2024 License: Apache-2.0 Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Database

type Database interface {
	FindOne(c context.Context, model interface{}, filter interface{}, item interface{}) error
	FindMany(c context.Context, model interface{}, filter interface{}, items interface{}) error
	FindPage(c context.Context, model interface{}, filter interface{}, page, size int, items interface{}) error
	Insert(c context.Context, model interface{}, item interface{}) error
	DeleteOne(c context.Context, model interface{}, item interface{}) error
	UpdateOne(c context.Context, model interface{}, filter interface{}, update interface{}) error
	UpsertOne(c context.Context, model interface{}, update map[string]interface{}, create interface{}) error
	Transaction(c context.Context, fn func(tx *gorm.DB) error) error
	Count(c context.Context, model interface{}, filter interface{}) (int64, error)
	Raw(c context.Context) *gorm.DB
	WithPage(page, size int) *gorm.DB
}

func NewDatabase

func NewDatabase(db *gorm.DB) Database

Jump to

Keyboard shortcuts

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