Skip to content

Commit

Permalink
Changed the sqlite db location
Browse files Browse the repository at this point in the history
  • Loading branch information
grrlopes committed Jul 13, 2023
1 parent bb0590a commit 231ca5c
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
1 change: 0 additions & 1 deletion repositories/fileparse/fconnector.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,5 @@ func OpenHist() (*os.File, error) {
os.Exit(1)
}


return data, err
}
8 changes: 7 additions & 1 deletion repositories/sqlite/connector.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,18 @@ package sqlite
import (
"database/sql"
"log"
"os"

_ "github.com/mattn/go-sqlite3"
)

func OpenDB() (*sql.DB, error) {
db, err := sql.Open("sqlite3", "sqlite.db")
var store = "/.local/share/storydb/"

homedir, err := os.UserHomeDir()
os.Mkdir(homedir+store, 0755)

db, err := sql.Open("sqlite3", homedir+store+"sqlite.db")
if err != nil {
log.Fatal("connector: ", err)
}
Expand Down

0 comments on commit 231ca5c

Please sign in to comment.