-
Notifications
You must be signed in to change notification settings - Fork 110
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
API refactor + Oracle fixes #577
Conversation
Compare upstream: nanodbc/nanodbc@0fe6c73
Use as appropriately ( Viewer.R ). Also: - Cleanup odbcConnectionColumns: - All S4 methods funnel to a single implementation point. - No more usage of connection_sql_columns ( outside of odbcConnectionColumns ) - Viewer.R: - Remove unnecessary dbListTables call in actions - list_catalogs is wrapped in tryCatch since not all back-ends support catalogs and some ( oracle ) throws an exception/error.
R/Viewer.R
Outdated
@@ -346,12 +347,12 @@ odbcConnectionActions.default <- function(connection) { | |||
tableName <- dbQuoteIdentifier(connection, firstTable$table_name) | |||
|
|||
# add schema | |||
if (!is.null(firstTable$table_schema) && nchar(firstTable$table_schema) > 0) { | |||
if (!is.null(firstTable$table_schema) && !is.na(firstTable$table_schema) && nchar(firstTable$table_schema) > 0) { |
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 level of type flexibility always makes me a bit nervous. Could we add some type checks higher up so we only need to check for one empty sentinel?
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.
Thanks Hadley:
As best as I can tell, the is.null(...)
that was there to begin-with is not guarding anything; I think only the is.na
is actually effective.
Kind of hesitant to remove the is.null
since I am not sure why it was there in the first place. But at the same time this is not in any critical code-path; we can revisit if removing it breaks something.
Co-authored-by: Hadley Wickham <hadley@posit.co>
Hi:
Fixes #575 , #540, #554
Some highlights:
Previously we had runaway usage of
connection_sql_tables
, which accommodates "magic" parameter ( combinations ). This makes it difficult to customize parts of its functionality for individual back-ends. Now some of the magic use cases are split out intoodbcConnectionCatalogs
,odbcConnectionSchemas
, andodbcConnectionTableTypes
.Specialize some of these for Oracle so that (hopefully) all of these are more performant ( and functional ): listing tables, writing to tables, and Rstudio/Viewer operations.