This commit is contained in:
sentriz
2019-05-19 23:28:05 +01:00
parent 5c657d9630
commit ad571ed7ab
45 changed files with 787 additions and 492 deletions

View File

@@ -1,22 +0,0 @@
package db
import (
"log"
"runtime"
"github.com/jinzhu/gorm"
)
var (
// cFile is the path to this go file
_, cFile, _, _ = runtime.Caller(0)
)
// New creates a new GORM connection to the database
func New() *gorm.DB {
db, err := gorm.Open("sqlite3", "gonic.db")
if err != nil {
log.Printf("when opening database: %v\n", err)
}
return db
}