Skip to content

Commit

Permalink
Always collect on SQL Server
Browse files Browse the repository at this point in the history
  • Loading branch information
krlmlr committed May 28, 2022
1 parent d9845b8 commit a6ec1f6
Showing 1 changed file with 13 additions and 1 deletion.
14 changes: 13 additions & 1 deletion R/meta.R
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
dm_meta <- function(con, catalog = NA, schema = NULL) {
need_collect <- FALSE

if (is_mssql(con)) {
if (is.null(catalog)) {
# FIXME: Classed error message?
Expand All @@ -14,13 +16,23 @@ dm_meta <- function(con, catalog = NA, schema = NULL) {
withr::defer({
dbExecute(con, old_sql, immediate = TRUE)
})
need_collect <- TRUE
}
}

con %>%
out <-
con %>%
dm_meta_raw(catalog) %>%
select_dm_meta() %>%
filter_dm_meta(catalog, schema)

if (need_collect) {
out <-
out %>%
collect()
}

out
}

dm_meta_raw <- function(con, catalog) {
Expand Down

0 comments on commit a6ec1f6

Please sign in to comment.