mirror of
https://github.com/davidallendj/magellan.git
synced 2025-12-20 03:27:03 -07:00
fix: change db.MustExec to db.Exec and handle error
This commit is contained in:
parent
a113a457d6
commit
5357aab06f
1 changed files with 4 additions and 1 deletions
5
internal/cache/sqlite/sqlite.go
vendored
5
internal/cache/sqlite/sqlite.go
vendored
|
|
@ -27,7 +27,10 @@ func CreateScannedAssetIfNotExists(path string) (*sqlx.DB, error) {
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, fmt.Errorf("failed to open database: %v", err)
|
return nil, fmt.Errorf("failed to open database: %v", err)
|
||||||
}
|
}
|
||||||
db.MustExec(schema)
|
_, err = db.Exec(schema)
|
||||||
|
if err != nil {
|
||||||
|
return nil, fmt.Errorf("failed to create scanned assets cache: %v", err)
|
||||||
|
}
|
||||||
return db, nil
|
return db, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue