set_app_connection {openappr}R Documentation

Set Application Database Connection

Description

Establishes a connection to a PostgreSQL database using provided credentials. This function utilises the DBI and RPostgres packages to set up the connection.

Usage

set_app_connection(dbname, host, port, user, password, ...)

Arguments

dbname

The name of the database to connect to.

host

The host name of the server where the database is located.

port

The port number to connect through.

user

The username for database authentication.

password

The password for database authentication.

...

Additional arguments passed to DBI::dbConnect.

Value

A database connection object of class DBIConnection.

See Also

dbConnect for more details on the underlying connection function. For additional information on database interfaces, see https://dbi.r-dbi.org/.

Examples

# Establish a connection to the PostgreSQL database
set_app_connection(
  dbname = "vmc",
  host = "apps-server.idems.international",
  port = 5432,
  user = "vmc",
  password = "LSQkyYg5KzL747"
)


[Package openappr version 0.2.0 Index]