Merge branch 'refactor/database' into feat/add
This commit is contained in:
commit
1a026913ac
1 changed files with 1 additions and 5 deletions
|
|
@ -17,7 +17,6 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|||
package cmd
|
||||
|
||||
import (
|
||||
"database/sql"
|
||||
"fmt"
|
||||
"freed/internal/database"
|
||||
"os"
|
||||
|
|
@ -37,7 +36,6 @@ type Config struct {
|
|||
|
||||
type AppContext struct {
|
||||
Config Config
|
||||
DB *sql.DB
|
||||
}
|
||||
|
||||
var (
|
||||
|
|
@ -104,11 +102,9 @@ func initConfig() {
|
|||
}
|
||||
|
||||
func initDB() {
|
||||
db, err := database.Connect(appContext.Config.DB.Path)
|
||||
err := database.Open(appContext.Config.DB.Path)
|
||||
|
||||
if err != nil {
|
||||
fmt.Printf("Could not connect to the database: %s", err)
|
||||
}
|
||||
|
||||
appContext.DB = db
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue