mxk/go-sqlite — pull request #3 by nobonobo (2014-06-04 01:02:17+00:00)
Title: added feature custom connection callback.

usage example

``` go
package main

import (
"database/sql"
"fmt"
"github.com/mxk/go-sqlite/sqlite3"
)

func main() {
sql.Register("sqlite3-hook", &sqlite3.Driver{func(conn *sqlite3.Conn) {
fmt.Println("connect:", conn)
if err := conn.Exec("pragma journal_mode=WAL;" +
"pragma read_uncommitted=true;" +
"pragma locking_mode=NORMAL;" +
"pragma synchronous=FULL;" +
"pragma busy_timeout=60000;" +
"pragma cache_spill=true;"); err != nil {
fmt.Println(err)
}
}})
db, err := sql.Open("sqlite3-hook", "file:db.sqlite3")
fmt.Println(db, err)
}
```