pg: define all C functions

pull/2882/head
Alexander Medvednikov 2019-11-25 06:48:48 +03:00
parent feacc2441f
commit 9bfea5e60b
2 changed files with 5 additions and 1 deletions

View File

@ -474,7 +474,7 @@ fn parse_url(rawurl string, via_request bool) ?URL {
if rawurl == '' && via_request { if rawurl == '' && via_request {
return error(error_msg('parse_url: empty URL', rawurl)) return error(error_msg('parse_url: empty URL', rawurl))
} }
mut url := URL{} mut url := URL{user:0}
if rawurl == '*' { if rawurl == '*' {
url.path = '*' url.path = '*'

View File

@ -29,6 +29,10 @@ fn C.PQconnectdb(a byteptr) &C.PGconn
fn C.PQerrorMessage(voidptr) byteptr fn C.PQerrorMessage(voidptr) byteptr
fn C.PQgetvalue(voidptr, int, int) byteptr fn C.PQgetvalue(voidptr, int, int) byteptr
fn C.PQstatus(voidptr) int 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 { pub fn connect(config pg.Config) DB {
conninfo := 'host=$config.host user=$config.user dbname=$config.dbname' conninfo := 'host=$config.host user=$config.user dbname=$config.dbname'