1
0
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:
jhuntos 2020-06-26 11:55:59 +02:00 committed by GitHub
parent 202d479bad
commit 20884c9576
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -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
}