add more info

master
兔子 2 years ago
parent b981b331e8
commit 393275a195

@ -12,13 +12,15 @@ import (
) )
type TxDetail struct { type TxDetail struct {
StartPos int StartPos int
EndPos int EndPos int
RowCount int RowCount int
Sql string Timestamp int64
Db string Time time.Time
Table string Sql string
SqlType string Db string
Table string
SqlType string
} }
type Transaction struct { type Transaction struct {
@ -189,13 +191,15 @@ func parseBinlogDetail(r io.Reader, f func(Transaction)) error {
default: default:
tx.EndPos = int(h.LogPos) tx.EndPos = int(h.LogPos)
tx.Txs = append(tx.Txs, TxDetail{ tx.Txs = append(tx.Txs, TxDetail{
StartPos: startPos, StartPos: startPos,
EndPos: int(h.LogPos), EndPos: int(h.LogPos),
Db: db, Db: db,
Table: tb, Table: tb,
Sql: sql, Sql: sql,
SqlType: sqlType, SqlType: sqlType,
RowCount: int(rowCnt), RowCount: int(rowCnt),
Timestamp: int64(h.Timestamp),
Time: time.Unix(int64(h.Timestamp), 0),
}) })
} }
} }

Loading…
Cancel
Save