postgreSQL.util.buildConnInfoString

Syntax

postgreSQL.util.buildConnInfoString (host, hostaddr, port, dbname, username, password, options)

Params

host is an optional string specifying the domain name of the database server.

hostaddr is an optional string specifying the IP address of the database server.

port is an optional number specifying the port on which the database server listens for incoming connections.

dbname is an optional string specifying the name of the database to connect to on the database server.

username is an optional string specifying the user name used to authenticate to the database server.

password is an optional string specifying the password used to authenticate to the database server.

options is an optional string specifying debug options to activate on the database server.

Action

Constructs a legal conninfo string from the specified parameters as understood by postgreSQL.connection.open and postgreSQL.pool.create.

Returns

A legal conninfo string.

Examples

postgreSQL.util.buildConnInfoString (hostaddr:"192.168.1.3", username:"test", password:"test")

« "hostaddr=192.168.1.3 user=test password=test"

Notes

Unspecified parameters will be omitted from the conninfo string. Single quotes in parameters will be escaped with a backslash. Parameters containing whitespace will be enclosed in single quotes.

For a detailed description of the key-value pairs in a legal conninfo string, see the notes for postgreSQL.connection.open.

See Also

postgreSQL.connection.open

postgreSQL.pool.create