mirror of
https://github.com/sonr-io/sonr.git
synced 2026-08-03 01:41:44 +00:00
refactor: rename database initialization function
This commit is contained in:
+1
-1
@@ -30,7 +30,7 @@ func setupServer(env config.Env) (*echo.Echo, error) {
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
db, err := sessions.InitDB(env)
|
||||
db, err := sessions.NewGormDB(env)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
@@ -9,8 +9,8 @@ import (
|
||||
"gorm.io/gorm"
|
||||
)
|
||||
|
||||
// InitDB initializes and returns a configured database connection
|
||||
func InitDB(env config.Env) (*gorm.DB, error) {
|
||||
// NewGormDB initializes and returns a configured database connection
|
||||
func NewGormDB(env config.Env) (*gorm.DB, error) {
|
||||
path := formatDBPath(env.GetSqliteFile())
|
||||
db, err := gorm.Open(sqlite.Open(path), &gorm.Config{})
|
||||
if err != nil {
|
||||
|
||||
Reference in New Issue
Block a user