aboutsummaryrefslogtreecommitdiff
path: root/_example/hook/hook.go
diff options
context:
space:
mode:
authorJason Abbott <Jason-Abbott@users.noreply.github.com>2017-07-03 12:59:20 -0600
committerGitHub <noreply@github.com>2017-07-03 12:59:20 -0600
commitdbaad204e95ad68c55137bcd7f879c9cb2fa9deb (patch)
treecc83849ec381c059e37faf0db7c7bb698ffa3fdd /_example/hook/hook.go
parentMerge pull request #431 from deepilla/issue-430 (diff)
parentIncorporate original PR 271 from https://github.com/brokensandals (diff)
downloadgolite-dbaad204e95ad68c55137bcd7f879c9cb2fa9deb.tar.gz
golite-dbaad204e95ad68c55137bcd7f879c9cb2fa9deb.tar.xz
Merge pull request #1 from toba/missing-callback-hooks
Incorporate original PR 271 from https://github.com/brokensandals
Diffstat (limited to '_example/hook/hook.go')
-rw-r--r--_example/hook/hook.go6
1 files changed, 6 insertions, 0 deletions
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
},
})