mirror of
https://github.com/vlang/v.git
synced 2023-08-10 21:13:21 +03:00
pg: call PQclean in rows()
This commit is contained in:
parent
202d479bad
commit
20884c9576
@ -36,6 +36,7 @@ fn C.PQntuples(voidptr) int
|
||||
fn C.PQnfields(voidptr) int
|
||||
fn C.PQexec(voidptr) voidptr
|
||||
fn C.PQexecParams(voidptr) voidptr
|
||||
fn C.PQclear(voidptr) voidptr
|
||||
|
||||
pub fn connect(config Config) ?DB {
|
||||
conninfo := 'host=$config.host port=$config.port user=$config.user dbname=$config.dbname password=$config.password'
|
||||
@ -61,6 +62,7 @@ fn res_to_rows(res voidptr) []Row {
|
||||
}
|
||||
rows << row
|
||||
}
|
||||
C.PQclear(res)
|
||||
return rows
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user