Add data with a data frame to your PostgreSQL database. The data frame name must match the table name in your database, if not use the tbl_name argument to pass the table name.

sbf_save_data_to_pg(
  x,
  x_name = NULL,
  schema = getOption("psql.schema", "public"),
  config_path = getOption("psql.config_path", NULL),
  config_value = getOption("psql.config_value", "default")
)

Arguments

x

The data frame to save.

x_name

A string of the name.

schema

A string of the schema name. Default value is "public".

config_path

A string of a file path to the yaml configuration file. The default value grabs the file path from the psql.config_path option and uses NULL if no value supplied.

config_value

A string of the name of value. The default value grabs the value from the psql.config_value option and uses "default" if no value is supplied.

Value

A scalar numeric.

Details

Wrapper on psql::psql_add_data()

Examples

if (FALSE) { # \dontrun{
sbf_save_data_to_pg(outing, "creel")
sbf_save_data_to_pg(outing_new, "creel", "outing")
} # }