Class to access Redshift database
conn
Database connection (JDBCConnection)
schema
Current database schema
columnTypes(tableName)
Get list of columns in table and their datatypes.
tableName
Name of the table (without schema).
Named vector, name is column name, value is datatype.
connect(host, db, user, password, schema, port = 5439)
Connect to Amazon Redshift database.
jdbcUrl
JDBC connection string.
username
Database user name.
password
Database password.
schema
Database schema.
port
Database server port.
TRUE
fetch(statement, maxmem = 5e+08, chunksize = -1)
Select via JDBC result set fetching to avoid memory restraints.
statement
Prepared Query statement.
maxmem
Upper limit in bytes of read - default 500MB.
chunksize
Rows to return per fetch - default 32k for 1st fetch, then 512k.
A data.frame with results
prepareStatement(sql, ...)
Prepare a SQL query with quoted parameters.
sql
SQL string, parameter placeholders are marked with ?.
...
Query parameters, number of parameters must be same as number of question marks.
SQL string
saveDataFrame(dfRaw, table, rowNumbers = FALSE, incremental = FALSE,
forcedColumnTypes, displayProgress)
Save a dataframe to database using bulk inserts. The table will be created to accomodate to data frame columns.
dfRaw
A data.frame, column names of data frame must correspond to column names of table.
table
Name of the table.
rowNumbers
If true then the table will contain a column named 'row_num' with sequential row index
incremental
If true then the table will not be recreated, only data will be inserted.
forcedColumnTypes
Optional list of column names and their respective types in database.
displayProgress
Optional logical, if set to true, saving progress will be displayed.
TRUE
select(sql, ...)
Select data from database.
sql
Query string, may contain placeholders ? for parameters.
...
Query parameters, number of parameters must be same as number of question marks.
A data.frame with results
tableExists(tableName)
Verify that a table exists in database.
tableName
Name of the table (without schema).
TRUE if the table exists, FALSE otherwise.
update(sql, ...)
Update/Insert data to database.
sql
Query string, may contain placeholders ? for parameters.
...
Query parameters.
TRUE
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.