Skip to content

Commit

Permalink
Add a check and warning for large queries
Browse files Browse the repository at this point in the history
  • Loading branch information
Moohan committed Sep 26, 2024
1 parent 750ef0b commit 63c7e78
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions R/get_resource_sql.R
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,13 @@ get_resource_sql <- function(sql) {
# attempt get request
content <- phs_GET("datastore_search_sql", query)

if (!is.null(content[["result"]][["records_truncated"]])) {
cli::cli_warn(
"The data was truncated because your query matched more than the
maximum number of rows."
)
}

# get correct order of columns
order <- purrr::map_chr(
content$result$fields,
Expand Down

0 comments on commit 63c7e78

Please sign in to comment.