Type: | Package |
Title: | User-Friendly PostgreSQL Connection Management |
Version: | 0.3.1 |
Maintainer: | Bobby Fatemi <bfatemi07@gmail.com> |
Description: | Provides a user-friendly interface for managing PostgreSQL database connection settings. The package supplies helper functions to create, edit and load connection and option configuration files stored in a user-specific directory using the 'odbc' and 'RPostgres' back ends. These helpers make it easy to construct a reproducible connection string from a configuration file, either by reading user-defined YAML files or by parsing an environment variable. |
Encoding: | UTF-8 |
License: | MIT + file LICENSE |
Language: | en-US |
RoxygenNote: | 7.3.2 |
Depends: | R (≥ 4.1.0) |
URL: | https://github.com/r-data-science/rpgconn |
BugReports: | https://github.com/r-data-science/rpgconn/issues |
Imports: | DBI, fs, RPostgres, stringr, usethis, yaml |
Suggests: | rstudioapi, spelling, testthat (≥ 3.0.0) |
Config/testthat/edition: | 3 |
NeedsCompilation: | no |
Packaged: | 2025-08-18 14:36:48 UTC; bobbyf |
Author: | Bobby Fatemi [aut, cre] |
Repository: | CRAN |
Date/Publication: | 2025-08-21 19:52:08 UTC |
Database Connect/Disconnect
Description
Database Connect/Disconnect
Usage
dbc(cfg = NULL, db = NULL, args_only = FALSE)
dbd(cn)
init_yamls()
dir_rpg()
edit_config()
edit_options()
Arguments
cfg |
a connection config name used when loading connection args from internally stored yaml |
db |
Database name. Default of NULL will utilize the dbname in the connection string |
args_only |
If TRUE, only return the connection arguments (Default FALSE will make the connection) |
cn |
a database connection object |
Value
dbc
returns a database connection object or a list of connection arguments while dbd
returns nothing
Functions
-
dbc()
: Connect to a database or return the connection arguments -
dbd()
: Disconnect from a database -
init_yamls()
: edit the internally configured connection parameters -
dir_rpg()
: get the path to the rpg settings directory -
edit_config()
: edit the internally configured connection parameters -
edit_options()
: edit the internally configured connection options
Examples
# cn <- dbc("mydb") # Connect
# dbd(cn) # Disconnect
Use New Config at Path
Description
Use New Config at Path
Usage
use_config(path, overwrite = FALSE)
Arguments
path |
path to new config yaml file to use |
overwrite |
overwrite existing config yaml set prior. Default FALSE |
Value
Invisible character vector giving the path to the active configuration file after it has been replaced. In non-interactive sessions the file is silently returned.