gormx

package
v1.0.4 Latest Latest
Warning

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

Go to latest
Published: Feb 19, 2024 License: Apache-2.0 Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func SqlInit

func SqlInit(c *gofkConfs.DBConfig) (*gorm.DB, error)

Types

type QueryFunc

type QueryFunc func(context.Context, SqlSession) error

type QueryOpts

type QueryOpts func(context.Context, ...SqlOptions) error

type QueryTakeFunc

type QueryTakeFunc func(context.Context, string, interface{}, SqlSession)

type SqlOptions

type SqlOptions func(newTx *gorm.DB) *gorm.DB

type SqlSession

type SqlSession interface {
	RawDB() *gorm.DB
	QueryScanContext(context.Context, interface{}, string, ...string) error
	QueryCountContext(ctx context.Context, total *int64, sql string, args ...string) error
	ExecSqlContext(context.Context, string, ...string) (bool, error)
	TransactCtx(context.Context, func(context context.Context, tx *gorm.DB) error) error

	QueryFromDB(ctx context.Context, db *gorm.DB, result interface{}) error
	CountFromDB(ctx context.Context, db *gorm.DB, total *int64) error
}

func NewSql

func NewSql(c *gofkConfs.DBConfig) SqlSession

func NewSqlFromDB

func NewSqlFromDB(db *gorm.DB) SqlSession

type TransFunc

type TransFunc func(context.Context, *gorm.DB) error

Jump to

Keyboard shortcuts

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