mirror of
https://github.com/ManyakRus/starter.git
synced 2025-11-28 23:20:10 +02:00
сделал tx = db.Begin()
This commit is contained in:
@@ -433,15 +433,15 @@ loop:
|
|||||||
func RawMultipleSQL(db *gorm.DB, TextSQL string) *gorm.DB {
|
func RawMultipleSQL(db *gorm.DB, TextSQL string) *gorm.DB {
|
||||||
var tx *gorm.DB
|
var tx *gorm.DB
|
||||||
var err error
|
var err error
|
||||||
tx = db
|
//tx = db
|
||||||
|
|
||||||
if tx == nil {
|
if db == nil {
|
||||||
log.Error("RawMultipleSQL() error: db =nil")
|
log.Error("RawMultipleSQL() error: db =nil")
|
||||||
return tx
|
return tx
|
||||||
}
|
}
|
||||||
|
|
||||||
//запустим транзакцию
|
//запустим транзакцию
|
||||||
tx.Begin()
|
tx = db.Begin()
|
||||||
defer tx.Commit()
|
defer tx.Commit()
|
||||||
|
|
||||||
//
|
//
|
||||||
|
|||||||
Reference in New Issue
Block a user