Incorporate original PR 271 from https://github.com/brokensandals

This commit is contained in:
Jason Abbott
2017-07-03 12:51:48 -06:00
parent 8a4c825cfc
commit 59bd281a89
4 changed files with 139 additions and 0 deletions

View File

@@ -14,6 +14,12 @@ func main() {
&sqlite3.SQLiteDriver{
ConnectHook: func(conn *sqlite3.SQLiteConn) error {
sqlite3conn = append(sqlite3conn, conn)
conn.RegisterUpdateHook(func(op int, db string, table string, rowid int64) {
switch op {
case sqlite3.SQLITE_INSERT:
log.Println("Notified of insert on db", db, "table", table, "rowid", rowid)
}
})
return nil
},
})