createTableFromDF: Create a Table with a Dataframe

Description Usage

Description

Derive DDL using the data classes of each field in a dataframe. The map between the R data classes and the Postgresql data types can be found at renderCreateTableFromDF. The dataframe can then be appended to the table using appendTable. This method is favorable to a direct call to writeTable because in some cases, future appends to the table may not adhere to the data definitions created at the time of writing. For example, writeTable defaults to VARCHAR(255) for all character classes whereas future appends may contain text greater than 255 characters, resulting in error. This function rolls all character classes to TEXT data types instead.

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
createTableFromDF(
  conn,
  conn_fun,
  schema,
  tableName,
  if_not_exists = TRUE,
  data,
  verbose = TRUE,
  render_sql = TRUE
)

patelm9/pg13 documentation built on Dec. 26, 2021, 8:17 p.m.