From 9bfea5e60b67362728d7de312b5a9dea7bc55602 Mon Sep 17 00:00:00 2001 From: Alexander Medvednikov Date: Mon, 25 Nov 2019 06:48:48 +0300 Subject: [PATCH] pg: define all C functions --- vlib/net/urllib/urllib.v | 2 +- vlib/pg/pg.v | 4 ++++ 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/vlib/net/urllib/urllib.v b/vlib/net/urllib/urllib.v index 8f42c4d047..6d132fb18f 100644 --- a/vlib/net/urllib/urllib.v +++ b/vlib/net/urllib/urllib.v @@ -474,7 +474,7 @@ fn parse_url(rawurl string, via_request bool) ?URL { if rawurl == '' && via_request { return error(error_msg('parse_url: empty URL', rawurl)) } - mut url := URL{} + mut url := URL{user:0} if rawurl == '*' { url.path = '*' diff --git a/vlib/pg/pg.v b/vlib/pg/pg.v index bc9a5e3aeb..5f7ffb12d8 100644 --- a/vlib/pg/pg.v +++ b/vlib/pg/pg.v @@ -29,6 +29,10 @@ fn C.PQconnectdb(a byteptr) &C.PGconn fn C.PQerrorMessage(voidptr) byteptr fn C.PQgetvalue(voidptr, int, int) byteptr fn C.PQstatus(voidptr) int +fn C.PQntuples(voidptr) int +fn C.PQnfields(voidptr) int +fn C.PQexec(voidptr) int +fn C.PQexecParams(voidptr) int pub fn connect(config pg.Config) DB { conninfo := 'host=$config.host user=$config.user dbname=$config.dbname'