1
0
mirror of https://github.com/vlang/v.git synced 2023-08-10 21:13:21 +03:00

pg: connect, use password

This commit is contained in:
Frederico Silva 2020-01-12 19:35:20 +01:00 committed by Alexander Medvednikov
parent f317b65808
commit 2678f9289e

View File

@ -35,7 +35,7 @@ fn C.PQexec(voidptr) voidptr
fn C.PQexecParams(voidptr) voidptr
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 password=$config.password'
conn := C.PQconnectdb(conninfo.str)
status := C.PQstatus(conn)
println("status=$status")