pg: define all C functions
parent
feacc2441f
commit
9bfea5e60b
|
@ -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 = '*'
|
||||||
|
|
|
@ -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'
|
||||||
|
|
Loading…
Reference in New Issue