From 74ff71ede5aaf7f5fb3dc9acf8df38206df7657f Mon Sep 17 00:00:00 2001 From: Jamie Foster Date: Tue, 15 Jul 2014 20:44:09 +0300 Subject: [PATCH] Add support for sqlite3 hook This is useful for adding backup functionality to SQLite as seen here: https://github.com/mattn/go-sqlite3/blob/master/_example/hook/hook.go In that sample, "sqlite3_with_hook_example" is the name of the driver to be registered. I used "sqlite3hook" in my fork as a generic name. Otherwise gorm will use SQLite in compatibility mode. --- dialect.go | 2 ++ 1 file changed, 2 insertions(+) diff --git a/dialect.go b/dialect.go index 20ba32d4..8b750438 100644 --- a/dialect.go +++ b/dialect.go @@ -28,6 +28,8 @@ func NewDialect(driver string) Dialect { d = &mysql{} case "sqlite3": d = &sqlite3{} + case "sqlite3hook": + d = &sqlite3{} default: fmt.Printf("`%v` is not officially supported, running under compatibility mode.\n", driver) d = &commonDialect{}