# NOT RUN {
df <- read.csv(local_file)
# Create new table, fail if already exists
write_civis(df, "schema.my_table", "my_database")
# Create new table, append if already exists
write_civis(df, "schema.my_table", "my_database", if_exists="append")
# Create new table with defined diskey / sortkeys for speed
write_civis(df, "schema.my_table", "my_database", distkey="id",
sortkey1="added_date")
# Create new table directly from a saved csv
write_civis("my/file/path.csv", "schema.my_table", "my_database")
# Create new table from a file_id
id <- write_civis_file("my/file/path.csv", name = "path.csv")
write_civis(id, "schema.my_table", "my_database")
# }
Run the code above in your browser using DataLab