From 39a9cfe23fc6dd768a050d8a06a1eecda2e09205 Mon Sep 17 00:00:00 2001 From: iChemy Date: Sat, 17 Feb 2024 13:08:46 +0900 Subject: [PATCH] :wastebasket:del override func and explicit dialector has SavePointerDialectorInterface --- infra/db/db.go | 20 +------------------- 1 file changed, 1 insertion(+), 19 deletions(-) diff --git a/infra/db/db.go b/infra/db/db.go index 1d41d839..d26f565f 100644 --- a/infra/db/db.go +++ b/infra/db/db.go @@ -71,6 +71,7 @@ func (repo *GormRepository) Setup(host, user, password, database, port, key, log // dialector with custom error handling type dialector struct { gorm.Dialector + gorm.SavePointerDialectorInterface } var ( @@ -86,22 +87,3 @@ func (d dialector) Translate(err error) error { return defaultErrorHandling(err) } - -func (d dialector) SavePoint(tx *gorm.DB, name string) error { - var err error = nil - if savePointer, ok := d.Dialector.(gorm.SavePointerDialectorInterface); ok { - err = savePointer.SavePoint(tx, name) - } else { - err = gorm.ErrUnsupportedDriver - } - return defaultErrorHandling(err) -} -func (d dialector) RollbackTo(tx *gorm.DB, name string) error { - var err error = nil - if savePointer, ok := d.Dialector.(gorm.SavePointerDialectorInterface); ok { - err = savePointer.RollbackTo(tx, name) - } else { - err = gorm.ErrUnsupportedDriver - } - return defaultErrorHandling(err) -}