reverted pgx changes

This commit is contained in:
2021-10-21 19:46:23 +02:00
parent 18282afcf6
commit 09571fc447

View File

@@ -9,6 +9,7 @@ import (
"csgowtfd/ent/player" "csgowtfd/ent/player"
"csgowtfd/ent/stats" "csgowtfd/ent/stats"
"csgowtfd/utils" "csgowtfd/utils"
"entgo.io/ent/dialect"
"entgo.io/ent/dialect/sql" "entgo.io/ent/dialect/sql"
"flag" "flag"
"fmt" "fmt"
@@ -722,7 +723,8 @@ func main() {
log.Fatalf("Failed to open database %s: %v", conf.Db.ConnectTo, err) log.Fatalf("Failed to open database %s: %v", conf.Db.ConnectTo, err)
} }
db.Client = ent.NewClient(ent.Driver(pdb)) drv := sql.OpenDB(dialect.Postgres, pdb.DB())
db.Client = ent.NewClient(ent.Driver(drv))
} else { } else {
db.Client, err = ent.Open(conf.Db.Driver, conf.Db.ConnectTo) db.Client, err = ent.Open(conf.Db.Driver, conf.Db.ConnectTo)
if err != nil { if err != nil {