-
Notifications
You must be signed in to change notification settings - Fork 48
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
ENH: New internal dm_meta()
for learning a data model from the database, for now for SQL Server only (#342)
#517
Conversation
@TSchiefer: This is as good as it gets in this iteration. Let's file follow-up tickets. What do we need to change before merging? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is great.
I didn't go through every detail, but the behavior is nice.
Shall we also already use dm_meta()
for learning from PG in this PR?
I tried it for both learning from a specific schema and without providing a schema name. It works great when providing a schema name, but I think we could filter out some or all of the non-user tables when not learning from a specific schema(?)
"constraint_schema", | ||
"constraint_type", | ||
"dbname", | ||
"FIXME", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is this intentional?
df_info <- | ||
info %>% | ||
dm_select_tbl(-schemata) %>% | ||
collect() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
collect()
is already done at the end of dm_meta()
if (is_mssql(con)) { | ||
if (is.null(catalog)) { | ||
# FIXME: Classed error message? | ||
abort("SQL server only supports learning from one database.") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
classed error msg in follow-up PR?
@@ -41,6 +41,130 @@ dm_learn_from_db <- function(dest, dbname = NULL, ...) { | |||
return() | |||
} | |||
|
|||
if (!is_mssql(con)) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
AFAICT, dm_meta()
works well for PG too. We could learn from PG using the function as well in this PR.
I forgot: should we also add a direct test for |
dm_meta()
for learning a data model from the database, for now for SQL Server only
dm_meta()
for learning a data model from the database, for now for SQL Server onlydm_meta()
for learning a data model from the database, for now for SQL Server only (#342)
Part of #342.