zdravko/internal/database.go

17 lines
274 B
Go
Raw Normal View History

2024-02-11 10:56:21 +00:00
package internal
import (
"github.com/glebarez/sqlite"
"gorm.io/gorm"
)
2024-02-11 11:57:57 +00:00
//go:generate just _generate-gorm
2024-02-11 10:56:21 +00:00
func ConnectToDatabase() (*gorm.DB, error) {
db, err := gorm.Open(sqlite.Open("gorm.db"), &gorm.Config{})
if err != nil {
return nil, err
}
return db, nil
}