get_data: Get data from database

Description Usage Arguments Value

View source: R/get_data.R

Description

Fetch a table or a specific query of a table from the database.

Usage

1
2
3
get_data(query = NULL, tab = NULL, dbname = NULL, host = NULL,
  port = NULL, user = NULL, password = NULL, connection_object = NULL,
  collect = TRUE)

Arguments

query

A SQL query as a chracter string of length 1

tab

As an alternative to query, the name of an entire table to return

dbname

The name of the database from which you are getting data. Example: portfolio. If NULL the function will try to use the dbname in your connection_object; if the connection_object is NULL, the function will try to create a connection_object as described below.

host

The name of the host from which you are getting data. If NULL the function will try to use the host in your connection_object; if the connection_object is NULL, the function will try to create a connection_object as described below.

port

The name of the port from which you are getting data. If NULL the function will try to use the port in your connection_object; if the connection_object is NULL, the function will try to create a connection_object as described below.

user

The user. If NULL the function will try to use the user in your connection_object; if the connection_object is NULL, the function will try to create a connection_object as described below.

password

The password If NULL the function will try to use the pqssword in your connection_object; if the connection_object is NULL, the function will try to create a connection_object as described below.

connection_object

An open connection to adatabase (as created through credentials_extract and credentials_connect or credentials_now); if NULL, the function will try to create a connection_object by retrieving user information from the credentials/credentials.yaml in or somewhere upwards of the working directory.

collect

Whether to collect into memory (using dplyr's connect function) the result or not

Value

A dataframe matching the results of either the query or tab arguments


databrew/portfoliodash documentation built on May 3, 2019, 1:47 p.m.