Example
PGClient
PGClient
host
, port
, username
): boolean
Connect connects to Postgres database using given credentials.
If connection is successful, it returns true.
If connection is unsuccessful, it returns false and error.
The connection is closed after the function returns.
Name | Type |
---|---|
host | string |
port | number |
username | string |
boolean
Example
host
, port
, username
): boolean
ConnectWithDB connects to Postgres database using given credentials and database name.
If connection is successful, it returns true.
If connection is unsuccessful, it returns false and error.
The connection is closed after the function returns.
Name | Type |
---|---|
host | string |
port | number |
username | string |
boolean
Example
host
, port
, username
): SQLResult
ExecuteQuery connects to Postgres database using given credentials and database name.
and executes a query on the db.
If connection is successful, it returns the result of the query.
Name | Type |
---|---|
host | string |
port | number |
username | string |
SQLResult
Example
host
, port
): boolean
IsPostgres checks if the given host and port are running Postgres database.
If connection is successful, it returns true.
If connection is unsuccessful, it returns false and error.
Name | Type |
---|---|
host | string |
port | number |
boolean
Example