mirror of
https://github.com/khairul169/vaulterm.git
synced 2026-09-15 17:03:30 +07:00
fix: macos fix can't open the app
This commit is contained in:
@@ -2,7 +2,6 @@ package db
|
||||
|
||||
import (
|
||||
"log"
|
||||
"os"
|
||||
"strings"
|
||||
|
||||
"gorm.io/driver/postgres"
|
||||
@@ -19,15 +18,9 @@ func Get() *gorm.DB {
|
||||
return dbInstance
|
||||
}
|
||||
|
||||
func Init() {
|
||||
func Init(dsn string) {
|
||||
// log.Println("Initializing database...")
|
||||
|
||||
dsn := os.Getenv("DATABASE_URL")
|
||||
if dsn == "" {
|
||||
// WAL: _journal_mode=WAL
|
||||
dsn = "file:data.db?cache=shared&mode=rwc"
|
||||
}
|
||||
|
||||
// Open db connection
|
||||
var con gorm.Dialector
|
||||
if strings.HasPrefix(dsn, "postgres:") {
|
||||
|
||||
Reference in New Issue
Block a user