database

package
v0.0.50 Latest Latest
Warning

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

Go to latest
Published: Nov 19, 2024 License: BSD-3-Clause Imports: 17 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	MAX_DATA int64
)

Functions

This section is empty.

Types

type DBFactory

type DBFactory struct{}

func (DBFactory) GetDB

func (ds DBFactory) GetDB(dbname string) (*gorm.DB, error)

type DBHelper

type DBHelper struct {
	// contains filtered or unexported fields
}

func NewDBHelper

func NewDBHelper() *DBHelper

func NewDBHelperByTable added in v0.0.17

func NewDBHelperByTable(table string) *DBHelper

func (*DBHelper) Count

func (helper *DBHelper) Count(db *gorm.DB, query interface{}) int64

func (*DBHelper) Delete

func (helper *DBHelper) Delete(db *gorm.DB, model interface{}) *gorm.DB

func (*DBHelper) Find

func (helper *DBHelper) Find(db *gorm.DB, query interface{}, orderBy interface{}, selects interface{}) Result

func (*DBHelper) First

func (helper *DBHelper) First(db *gorm.DB, query interface{}, orderBy interface{}, selects interface{}) Result

func (*DBHelper) Insert

func (helper *DBHelper) Insert(db *gorm.DB, model interface{}) *gorm.DB

func (*DBHelper) Last

func (helper *DBHelper) Last(db *gorm.DB, query interface{}, orderBy interface{}, selects interface{}) Result

func (*DBHelper) Page

func (helper *DBHelper) Page(db *gorm.DB, query interface{}, page Page, orderBy interface{}, selects interface{}) Result

func (*DBHelper) Save

func (helper *DBHelper) Save(db *gorm.DB, model interface{}) *gorm.DB

func (*DBHelper) Update

func (helper *DBHelper) Update(db *gorm.DB, id any, model interface{}) *gorm.DB

type IDBHelper

type IDBHelper interface {
	Insert(db *gorm.DB, model interface{}) *gorm.DB
	Delete(db *gorm.DB, model interface{}) *gorm.DB
	Update(db *gorm.DB, id string, model interface{}) *gorm.DB
	Save(db *gorm.DB, model interface{}) *gorm.DB
	Find(db *gorm.DB, query interface{}) Result
	First(db *gorm.DB, query interface{}) Result
	Last(db *gorm.DB, query interface{}) Result
	Count(db *gorm.DB, query interface{}) int64
	Page(db *gorm.DB, query interface{}, page Page) Result
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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