Commit Graph

6 Commits

Author SHA1 Message Date
mattn 691a8a9de3 Use sqlite3.c in all platforms 2013-08-28 14:46:33 +09:00
Carlos Castillo 0dd71564e2 Changed extension support to load from a string list of extensions
By loading extensions this way, it's not possible to later load
extensions using db.Exec, which improves security, and makes it much
easier to load extensions correctly. The zero value for the slice
(the empty slice) loads no extensions by default.

The extension example has been updated to use this much simpler system.

The ConnectHook field is still in SQLiteDriver in case it's needed for
other driver-wide initialization.

Updates #71 of mattn/go-sqlite3.
2013-08-24 20:36:35 -07:00
Carlos Castillo 976f43861f Added error return to ConnectHook and fixed extension example
The ConnectHook field of an SQLiteDriver should return an error in
case something bad happened during the hook.

The extension example needs to load the extension in a ConnectHook,
otherwise the extension is only loaded in a single connection in the pool.
By putting the extension loading in the ConnectHook, its called for every
connection that is opened by the sql.DB.
2013-08-24 20:04:51 -07:00
mattn ac279b69bf Fixes typo 2013-08-23 14:26:33 +09:00
mattn e6850435ff Possible to register custom driver 2013-08-23 13:58:54 +09:00
mattn 3420c2b872 Add example for sqlite3_with_extensions 2013-08-23 09:58:27 +09:00