yt-gen-app/lib/templ/tmpl/backend/db/transaction.tmpl
2023-07-26 16:19:28 +03:00

18 lines
254 B
Cheetah

// This file generated automatic. Do not change this!
package db
import "gorm.io/gorm"
func BeginTransation() *gorm.DB {
return DB.Begin()
}
func EndTransaction(tx *gorm.DB, err error) {
if err != nil {
tx.Rollback()
} else {
tx.Commit()
}
}