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:
parent
f317b65808
commit
2678f9289e
@ -35,7 +35,7 @@ fn C.PQexec(voidptr) voidptr
|
|||||||
fn C.PQexecParams(voidptr) voidptr
|
fn C.PQexecParams(voidptr) voidptr
|
||||||
|
|
||||||
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 password=$config.password'
|
||||||
conn := C.PQconnectdb(conninfo.str)
|
conn := C.PQconnectdb(conninfo.str)
|
||||||
status := C.PQstatus(conn)
|
status := C.PQstatus(conn)
|
||||||
println("status=$status")
|
println("status=$status")
|
||||||
|
Loading…
Reference in New Issue
Block a user