mirror of
https://github.com/tiger1103/gfast.git
synced 2026-09-22 02:27:54 +00:00
导入sql事务
This commit is contained in:
@@ -689,7 +689,7 @@ func (s *toolsGenTable) writeDb(path string, ctx context.Context) (err error) {
|
||||
sql := strings.Join(sqlStr, "")
|
||||
gstr.ReplaceByArray(sql, []string{"@parentId", gconv.String(id), "@now", now.Format("Y-m-d H:i:s")})
|
||||
//插入业务
|
||||
res, err = g.DB().Exec(sql)
|
||||
res, err = tx.Exec(sql)
|
||||
if err != nil {
|
||||
tx.Rollback()
|
||||
return
|
||||
|
||||
Reference in New Issue
Block a user