AZASRS_DATABASE_CONNECTION: Opens a database connection

Description Usage Arguments Value Examples

View source: R/database_globals.R

Description

Uses AZASRS_DATABASE_LOCATION and should only be used with tbl_ functions. Allows for chaining of tbl_ functions to optimize SQL queries. Must close connection after usage. You must have .Renviron on your computer in the directory found by executing normalizePath('~/') in your console. Environment variables in there will allow you to connect to the database.

Usage

1
AZASRS_DATABASE_CONNECTION(development = 0)

Arguments

development

signifies whether to use development or productions database (production = 0, development = 1) – default is production

Value

MS SQL database connection (Azure SQL)

Examples

1
2
3
4
con <- AZASRS_DATABASE_CONNECTION()
data <- tbl_pm_fund_nav_daily(con) %>%
  left_join(tbl_pm_fund_info(con), by = "pm_fund_id") %>%
  as_tibble()

AZASRS/AZASRS documentation built on Sept. 30, 2020, 9:26 p.m.