pgdbconn: Database Connect/Disconnect
Description
Database Connect/Disconnect
Usage
dbc(cfg = NULL, db = NULL, args_only = FALSE, cfg_path = NULL, opt_path = NULL)dbd(cn)
init_yamls()
dir_rpg()
edit_config()
edit_options()
Value
dbc returns a database connection object or a list of connection arguments while dbd returns nothing
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)
- cfg_path
optional path to override default db config file.
- opt_path
optional path to override default db options file.
- cn
a database connection object
Functions
dbc(): Connect to a database or return the connection arguments
dbd(): Disconnect from a database
init_yamls(): Initialize connection files
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
Run this code# cn <- dbc("mydb") # Connect
# dbd(cn) # Disconnect
Run the code above in your browser using DataLab