Skip to content

Commit

Permalink
Work around permission issues
Browse files Browse the repository at this point in the history
  • Loading branch information
krlmlr committed May 30, 2022
1 parent 6d7ed22 commit 938cfe7
Showing 1 changed file with 4 additions and 5 deletions.
9 changes: 4 additions & 5 deletions R/learn.R
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,10 @@ dm_learn_from_db_meta <- function(con, catalog = NULL, schema = NULL, name_forma
left_join(columns, select = c(column_name, dm_name, table_catalog, table_schema, table_name)) %>%
dm_update_zoomed() %>%
dm_zoom_to(constraint_column_usage) %>%
left_join(columns, select = c(column_name, dm_name, table_catalog, table_schema, table_name)) %>%

# inner_join(): Matching column sometimes not found on Postgres
inner_join(columns, select = c(column_name, dm_name, table_catalog, table_schema, table_name)) %>%

dm_update_zoomed() %>%
dm_select_tbl(-columns) %>%
dm_rename(constraint_column_usage, constraint_column_usage.table_catalog = table_catalog) %>%
Expand Down Expand Up @@ -153,10 +156,6 @@ dm_learn_from_db_meta <- function(con, catalog = NULL, schema = NULL, name_forma
))) %>%
ungroup() %>%
select(-(1:3)) %>%

# FIXME: Where does this come from?
filter(!is.na(ref_table)) %>%

group_by(table = ref_table) %>%
summarize(fks = list(bind_rows(fks))) %>%
ungroup()
Expand Down

0 comments on commit 938cfe7

Please sign in to comment.