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.
This commit is contained in:
Jamie Foster 2014-07-15 20:44:09 +03:00
parent 3eb4adafba
commit 74ff71ede5

View File

@ -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{}