aboutsummaryrefslogtreecommitdiff
path: root/mediaapi/storage/sqlite3/storage.go
diff options
context:
space:
mode:
Diffstat (limited to 'mediaapi/storage/sqlite3/storage.go')
-rw-r--r--mediaapi/storage/sqlite3/storage.go7
1 files changed, 5 insertions, 2 deletions
diff --git a/mediaapi/storage/sqlite3/storage.go b/mediaapi/storage/sqlite3/storage.go
index a1e7fec7..d5c3031e 100644
--- a/mediaapi/storage/sqlite3/storage.go
+++ b/mediaapi/storage/sqlite3/storage.go
@@ -31,16 +31,19 @@ import (
type Database struct {
statements statements
db *sql.DB
+ writer sqlutil.Writer
}
// Open opens a postgres database.
func Open(dbProperties *config.DatabaseOptions) (*Database, error) {
- var d Database
+ d := Database{
+ writer: sqlutil.NewExclusiveWriter(),
+ }
var err error
if d.db, err = sqlutil.Open(dbProperties); err != nil {
return nil, err
}
- if err = d.statements.prepare(d.db); err != nil {
+ if err = d.statements.prepare(d.db, d.writer); err != nil {
return nil, err
}
return &d, nil