mirror of
https://github.com/vlang/v.git
synced 2023-08-10 21:13:21 +03:00
hot code reloading examples
This commit is contained in:
@@ -25,6 +25,7 @@ struct C.PGResult { }
|
||||
|
||||
fn C.PQconnectdb(a byteptr) *C.PGconn
|
||||
fn C.PQerrorMessage(voidptr) byteptr
|
||||
fn C.PQgetvalue(voidptr, int, int) byteptr
|
||||
|
||||
pub fn connect(dbname, user string) DB {
|
||||
conninfo := 'host=localhost user=$user dbname=$dbname'
|
||||
@@ -46,7 +47,7 @@ fn res_to_rows(res voidptr) []pg.Row {
|
||||
mut row := Row{}
|
||||
for j := 0; j < nr_cols; j++ {
|
||||
val := C.PQgetvalue(res, i, j)
|
||||
row.vals << string(val)
|
||||
row.vals << string(val)
|
||||
}
|
||||
rows << row
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user