Commit 8da40ff0 authored by gwenn's avatar gwenn

Sets multi-thread mode for driver by default.

Indeed, the database/sql package ensures that sqlite connections are
used only by on goroutine at a time.
The timeout has been increased to make go-sql-test passed.
parent 4cbd9b68
......@@ -20,6 +20,8 @@ func init() {
log.Printf("%s: %s, %s\n", d, err, msg)
}, "SQLITE")
}
ConfigThreadingMode(MultiThread)
ConfigMemStatus(false)
}
// Adapter to database/sql/driver
......@@ -41,13 +43,13 @@ type rowsImpl struct {
// Open opens a new database connection.
// ":memory:" for memory db,
// "" for temp file db
// TODO How to specify open flags?
// TODO How to specify open flags? SQLITE_OPEN_NOMUTEX
func (d *Driver) Open(name string) (driver.Conn, error) {
c, err := Open(name)
if err != nil {
return nil, err
}
c.BusyTimeout(500)
c.BusyTimeout(10000)
return &connImpl{c}, nil
}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment