sbf_save_data_to_pg: Add data frame to PostgreSQL database

View source: R/pg.R

sbf_save_data_to_pgR Documentation

Add data frame to PostgreSQL database

Description

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.

Usage

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.

Details

Wrapper on psql::psql_add_data()

Value

A scalar numeric.

See Also

Other postgresql functions: sbf_backup_pg(), sbf_close_pg(), sbf_create_pg(), sbf_execute_pg(), sbf_get_config_file(), sbf_get_config_value(), sbf_get_schema(), sbf_list_tables_pg(), sbf_load_data_from_pg(), sbf_load_datas_from_pg(), sbf_open_pg(), sbf_reset_config_file(), sbf_reset_config_value(), sbf_reset_schema(), sbf_set_config_file(), sbf_set_config_value(), sbf_set_schema()

Other save functions: sbf_basename_sans_ext(), sbf_save_aws_files(), sbf_save_block(), sbf_save_data(), sbf_save_data_to_db(), sbf_save_datas(), sbf_save_datas_to_db(), sbf_save_db_metatable_descriptions(), sbf_save_db_to_workbook(), sbf_save_excel(), sbf_save_excels(), sbf_save_gpkg(), sbf_save_gpkgs(), sbf_save_number(), sbf_save_numbers(), sbf_save_object(), sbf_save_objects(), sbf_save_plot(), sbf_save_png(), sbf_save_string(), sbf_save_strings(), sbf_save_table(), sbf_save_window(), sbf_save_workbook()

Examples

## Not run: 
sbf_save_data_to_pg(outing, "creel")
sbf_save_data_to_pg(outing_new, "creel", "outing")

## End(Not run)

poissonconsulting/subfoldr2 documentation built on Nov. 1, 2024, 9:10 p.m.