From efb45579aa6f61cbce0cc6c0dcfd6727b019a904 Mon Sep 17 00:00:00 2001 From: Alexander Medvednikov Date: Fri, 6 Mar 2020 02:01:53 +0100 Subject: [PATCH] pg: add port to config --- vlib/pg/pg.v | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/vlib/pg/pg.v b/vlib/pg/pg.v index 18b3c94594..af7ee527d6 100644 --- a/vlib/pg/pg.v +++ b/vlib/pg/pg.v @@ -20,6 +20,7 @@ struct C.PGResult { } pub struct Config { pub: host string + port int user string password string dbname string @@ -35,7 +36,7 @@ fn C.PQexec(voidptr) voidptr fn C.PQexecParams(voidptr) voidptr pub fn connect(config pg.Config) ?DB { - conninfo := 'host=$config.host user=$config.user dbname=$config.dbname password=$config.password' + conninfo := 'host=$config.host port=$config.port user=$config.user dbname=$config.dbname password=$config.password' conn := C.PQconnectdb(conninfo.str) status := C.PQstatus(conn) println("status=$status")