View source: R/db-create_tbl.R
create_tbl | R Documentation |
Creates a database table given a connection, table name, and:
SQL file specifying the table's schema
CSV file to seed the table's values
create_tbl(
conn,
tbl_name,
csv_path = "data-raw/database/CSV",
sql_path = "data-raw/database/SQL",
drop_if_exists = TRUE
)
conn |
database connection |
tbl_name |
character string representing table name |
csv_path |
base path (excluding file) to the CSV file |
sql_path |
base path (excluding file) to the SQL file |
drop_if_exists |
Should the table be dropped (with CASCADE) if it already exists? |
the created database table returned as an R data.frame()
.
It is assumed that the tbl_name
mirrors both the basename of the CSV file
and the SQL file (excluding extensions).
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.