aboutsummaryrefslogtreecommitdiff
path: root/mediaapi
diff options
context:
space:
mode:
Diffstat (limited to 'mediaapi')
-rw-r--r--mediaapi/storage/sqlite3/storage.go6
-rw-r--r--mediaapi/storage/storage_wasm.go2
2 files changed, 6 insertions, 2 deletions
diff --git a/mediaapi/storage/sqlite3/storage.go b/mediaapi/storage/sqlite3/storage.go
index 6da7132d..ea81f912 100644
--- a/mediaapi/storage/sqlite3/storage.go
+++ b/mediaapi/storage/sqlite3/storage.go
@@ -37,7 +37,11 @@ type Database struct {
func Open(dataSourceName string) (*Database, error) {
var d Database
var err error
- if d.db, err = sqlutil.Open(internal.SQLiteDriverName(), dataSourceName, nil); err != nil {
+ cs, err := sqlutil.ParseFileURI(dataSourceName)
+ if err != nil {
+ return nil, err
+ }
+ if d.db, err = sqlutil.Open(internal.SQLiteDriverName(), cs, nil); err != nil {
return nil, err
}
if err = d.statements.prepare(d.db); err != nil {
diff --git a/mediaapi/storage/storage_wasm.go b/mediaapi/storage/storage_wasm.go
index aa188997..78de2cb8 100644
--- a/mediaapi/storage/storage_wasm.go
+++ b/mediaapi/storage/storage_wasm.go
@@ -35,7 +35,7 @@ func Open(
case "postgres":
return nil, fmt.Errorf("Cannot use postgres implementation")
case "file":
- return sqlite3.Open(uri.Path)
+ return sqlite3.Open(dataSourceName)
default:
return nil, fmt.Errorf("Cannot use postgres implementation")
}