chore(sqlite): add Open() utility func

This commit is contained in:
2023-03-03 16:37:19 +01:00
parent fef0321475
commit 6399196fe5
2 changed files with 13 additions and 5 deletions

View File

@ -1,7 +1,6 @@
package app
import (
"database/sql"
"fmt"
"net/http"
"path/filepath"
@ -26,8 +25,6 @@ import (
"github.com/golang-jwt/jwt"
"github.com/pkg/errors"
"github.com/urfave/cli/v2"
_ "modernc.org/sqlite"
)
func RunCommand() *cli.Command {
@ -115,9 +112,9 @@ func RunCommand() *cli.Command {
bus := memory.NewBus()
db, err := sql.Open("sqlite", storageFile)
db, err := sqlite.Open(storageFile)
if err != nil {
return errors.Wrapf(err, "could not open database with path '%s'", storageFile)
return errors.WithStack(err)
}
ds := sqlite.NewDocumentStoreWithDB(db)