mirror of
https://github.com/documize/community.git
synced 2025-07-24 07:39:43 +02:00
removed named sql statements
This commit is contained in:
parent
9ccd0fd19c
commit
8f80673cde
32 changed files with 218 additions and 937 deletions
|
@ -40,21 +40,15 @@ func (s Scope) Record(ctx domain.RequestContext, t audit.EventType) {
|
|||
return
|
||||
}
|
||||
|
||||
stmt, err := tx.Preparex("INSERT INTO userevent (orgid, userid, eventtype, ip, created) VALUES (?, ?, ?, ?, ?)")
|
||||
_, err = tx.Exec("INSERT INTO userevent (orgid, userid, eventtype, ip, created) VALUES (?, ?, ?, ?, ?)",
|
||||
e.OrgID, e.UserID, e.Type, e.IP, e.Created)
|
||||
|
||||
if err != nil {
|
||||
tx.Rollback()
|
||||
s.Runtime.Log.Error("prepare audit insert", err)
|
||||
return
|
||||
}
|
||||
|
||||
_, err = stmt.Exec(e.OrgID, e.UserID, e.Type, e.IP, e.Created)
|
||||
if err != nil {
|
||||
tx.Rollback()
|
||||
s.Runtime.Log.Error("execute audit insert", err)
|
||||
return
|
||||
}
|
||||
|
||||
stmt.Close()
|
||||
tx.Commit()
|
||||
|
||||
return
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue