mirror of
https://github.com/davidallendj/magellan.git
synced 2025-12-20 11:37:01 -07:00
fix: change db.MustExec to db.Exec and handle error
This commit is contained in:
parent
4e7d011cd0
commit
7498aa5890
1 changed files with 4 additions and 1 deletions
5
internal/cache/sqlite/sqlite.go
vendored
5
internal/cache/sqlite/sqlite.go
vendored
|
|
@ -28,7 +28,10 @@ func CreateScannedAssetIfNotExists(path string) (*sqlx.DB, error) {
|
|||
if err != nil {
|
||||
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
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue