aboutsummaryrefslogtreecommitdiff
path: root/sqlite3.go
diff options
context:
space:
mode:
Diffstat (limited to 'sqlite3.go')
-rw-r--r--sqlite3.go6
1 files changed, 4 insertions, 2 deletions
diff --git a/sqlite3.go b/sqlite3.go
index 692306d..cc42c13 100644
--- a/sqlite3.go
+++ b/sqlite3.go
@@ -78,7 +78,7 @@ func init() {
// Driver struct.
type SQLiteDriver struct {
EnableLoadExtension bool
- ConnectHook func(*SQLiteConn)
+ ConnectHook func(*SQLiteConn) error
}
// Conn struct.
@@ -194,7 +194,9 @@ func (d *SQLiteDriver) Open(dsn string) (driver.Conn, error) {
conn := &SQLiteConn{db}
if d.ConnectHook != nil {
- d.ConnectHook(conn)
+ if err := d.ConnectHook(conn); err != nil {
+ return nil, err
+ }
}
return conn, nil