gorm

package
v1.7.6 Latest Latest
Warning

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

Go to latest
Published: Dec 23, 2025 License: MIT, Apache-2.0 Imports: 7 Imported by: 4

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Delete

func Delete(db *gorm.DB, tableName string, column string, value any) error

func DeleteById

func DeleteById(db *gorm.DB, tableName string, id uint64) error

func Exists

func Exists(db *gorm.DB, tableName, column string, value interface{}, withDeletedAt bool) (bool, error)

func ExistsByColumn

func ExistsByColumn(db *gorm.DB, tableName, column string, value interface{}) (bool, error)

func ExistsByColumnWithDeletedAt

func ExistsByColumnWithDeletedAt(db *gorm.DB, tableName, column string, value interface{}) (bool, error)

func ExistsByFilterExprs

func ExistsByFilterExprs(db *gorm.DB, tableName string, filters sqlx.FilterExprs) (bool, error)

func ExistsByQuery

func ExistsByQuery(db *gorm.DB, qsql string, value ...any) (bool, error)

根据查询语句查询数据是否存在

func ExistsBySQL

func ExistsBySQL(db *gorm.DB, sql string, value ...any) (bool, error)

func GetById

func GetById[T any](db *gorm.DB, id any) (*T, error)

func NewDBWithContext

func NewDBWithContext(db *gorm.DB, ctx context.Context) *gorm.DB

func NewDBWithLogger

func NewDBWithLogger(db *gorm.DB, log *log.Logger, conf *logger.Config) *gorm.DB

func NewTraceDB

func NewTraceDB(db *gorm.DB, ctx context.Context, traceId string) *gorm.DB

func TableName

func TableName(tx *gorm.DB, name string) *gorm.DB

Types

This section is empty.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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