Carto API requires a file name but httr::write_disk file path will override it. So we can use any dummy file name for API call.

sql_inquiry_save(inquiry, filepath, parameter = "")

Arguments

inquiry
sql inquiry string
filepath
output file path
parameter
additional parameter to sql inquiry, like file format, by default in JSON, could be GeoJSON

Value

request status

Examples

sql_inquiry_save("SELECT * FROM table_1 limit 2", "e:/testgeo.json", "&format=GeoJSON")
#> Error in curl::curl_fetch_disk(url, x$path, handle = handle): Failed to open file e:/testgeo.json.
sql_inquiry_save("SELECT * FROM table_1 limit 2", "e:/test.json")
#> Error in curl::curl_fetch_disk(url, x$path, handle = handle): Failed to open file e:/test.json.