21 lines
298 B
Go
Raw Permalink Normal View History

2024-03-31 20:09:20 +08:00
package database
import (
"context"
"github.com/loveuer/nfflow/internal/opt"
"gorm.io/gorm"
)
type _db struct {
client *gorm.DB
}
func (d *_db) Session(ctx context.Context) *gorm.DB {
s := d.client.Session(&gorm.Session{})
if opt.Debug > 0 || opt.DBDebug {
s = s.Debug()
}
return s
}