generated from pkg/go-template
This commit is contained in:
+7
-4
@@ -12,11 +12,14 @@ import (
|
||||
"time"
|
||||
)
|
||||
|
||||
func GetContextDB(ctx context.Context, db *gorm.DB) (*gorm.DB, error) {
|
||||
if err := db.Use(&TracePlugin{}); err != nil {
|
||||
return nil, err
|
||||
func init() {
|
||||
if err := DB.Use(&TracePlugin{}); err != nil {
|
||||
panic(err)
|
||||
}
|
||||
return db.WithContext(ctx), nil
|
||||
}
|
||||
|
||||
func GetContextDB(ctx context.Context) (*gorm.DB, error) {
|
||||
return DB.WithContext(ctx), nil
|
||||
}
|
||||
|
||||
type SQL struct {
|
||||
|
||||
Reference in New Issue
Block a user