~emersion/sinwon

841b30b547d484220b3da099a00ff962daddba53 — Simon Ser 7 months ago 005f45b
Set SQLite concurrency options
1 files changed, 2 insertions(+), 1 deletions(-)

M db.go
M db.go => db.go +2 -1
@@ 29,10 29,11 @@ type DB struct {
}

func openDB(filename string) (*DB, error) {
	sqlDB, err := sql.Open("sqlite3", filename)
	sqlDB, err := sql.Open("sqlite3", filename+"?cache=shared")
	if err != nil {
		return nil, err
	}
	sqlDB.SetMaxOpenConns(1)

	db := &DB{sqlDB}
	if err := db.init(context.TODO()); err != nil {