database issues

This commit is contained in:
Karmanyaah Malhotra
2021-02-28 15:02:11 -05:00
parent b8044adf3f
commit daf1edffb7
4 changed files with 11 additions and 13 deletions

View File

@ -17,6 +17,7 @@
package database
import (
"os"
"strings"
_ "github.com/lib/pq"
@ -48,6 +49,8 @@ func New(dbType string, uri string, baseLog log.Logger) (*Database, error) {
if dbType == "sqlite3" {
//_, _ = conn.Exec("PRAGMA foreign_keys = ON")
log.Fatalln("no sqlite for now only postgresql")
os.Exit(1)
conn = sqlite.Open(uri)
} else {
conn = postgres.Open(uri)