From 59bd281a89883d39ef219699e4a46eab87b3cff9 Mon Sep 17 00:00:00 2001 From: Jason Abbott Date: Mon, 3 Jul 2017 12:51:48 -0600 Subject: Incorporate original PR 271 from https://github.com/brokensandals --- _example/hook/hook.go | 6 ++++++ 1 file changed, 6 insertions(+) (limited to '_example/hook/hook.go') diff --git a/_example/hook/hook.go b/_example/hook/hook.go index 17bddeb..6023181 100644 --- a/_example/hook/hook.go +++ b/_example/hook/hook.go @@ -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 }, }) -- cgit v1.2.3