diff --git a/engine/db.go b/engine/db.go index 9c18bd5..519b13a 100644 --- a/engine/db.go +++ b/engine/db.go @@ -4,6 +4,7 @@ import ( "github.com/jackc/pgx/pgxpool" "context" "log" + "fmt" ) func writePost(pool *pgxpool.Pool, reportpost ReportPost) { @@ -51,7 +52,8 @@ func writePost(pool *pgxpool.Pool, reportpost ReportPost) { func get_db_pool() (*pgxpool.Pool) { // Setup Database - pool, err := pgxpool.Connect(context.Background(), "postgres://postgres@127.0.0.1/fedilogue") + db_uri := fmt.Sprintf("postgres://%s:%s@%s:%d/fedilogue", settings.Database.Username, settings.Database.Password, settings.Database.Host, settings.Database.Port) + pool, err := pgxpool.Connect(context.Background(), db_uri) if err != nil { log.Fatal("Unable to connect to database:", err) }