Function to get data from a table on the WRDS PostgreSQL server and save to local parquet file using DuckDB.
Usage
pg_to_parquet(table_name, schema, data_dir = Sys.getenv("DATA_DIR"))Examples
if (FALSE) { # \dontrun{
# Requires PostgreSQL credentials for a WRDS database and the duckdb package.
local({
data_dir <- tempfile("farr-example-")
dir.create(data_dir)
on.exit(unlink(data_dir, recursive = TRUE), add = TRUE)
pg_to_parquet("dsi", "crsp", data_dir = data_dir)
})
} # }