Description Usage Arguments Value Author(s)
This function performs all the actions needed to run a query that returns tabular data from a PostgreSQL server. It handles connecting, querying and disconnecting. The query can either be passed directly as a string or as a path to a file containing a SQL statement.
The yaml file must contain host, dbname, user and password. Port is optional, if not present in the yaml file, the default for PostgreSQL will be used.
This function was created to run quick queries on Redshift. The difference between this function and RedshiftQuery is that RedshiftQuery was built to unload results to an S3 bucket and should the prefered option for large queries.
1 | PostgreSQLQuery(query, id, yamlFile = "~/db.yml", printProgress = TRUE)
|
query |
The query to be ran. It can be a file with SQL or a character vector |
id |
The server ID in the yaml config file |
yamlFile |
The server configuration yaml file |
A dataframe with the result of the query
Ricardo Vladimiro
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.