Skip to content
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

Allow drivers to be filtered from odbcListDrivers #274

Merged
merged 4 commits into from Nov 8, 2019

Conversation

blairj09
Copy link
Contributor

This option allows users or system administrators to set the odbc.drivers.filter option in order to exclude some/all drivers from being returned by odbcListDrivers(). This can be helpful for system administrators who don't want users seeing all the available drivers and/or who don't want the IDE to provide automatic references to installed drivers in the connections pane.

Example:

odbc::odbcListDrivers()
#>          name attribute
#> 1      Athena    Driver
#> 2    BigQuery    Driver
#> 3   Cassandra    Driver
#> 4        Hive    Driver
#> 5      Impala    Driver
#> 6     MongoDB    Driver
#> 7       MySQL    Driver
#> 8     Netezza    Driver
#> 9      Oracle    Driver
#> 10 PostgreSQL    Driver
#> 11   Redshift    Driver
#> 12 Salesforce    Driver
#> 13  SQLServer    Driver
#> 14   Teradata    Driver
#>                                                                  value
#> 1            /opt/rstudio-drivers/athena/bin/lib/libathenaodbc_sb64.so
#> 2  /opt/rstudio-drivers/bigquery/bin/lib/libgooglebigqueryodbc_sb64.so
#> 3      /opt/rstudio-drivers/cassandra/bin/lib/libcassandraodbc_sb64.so
#> 4                /opt/rstudio-drivers/hive/bin/lib/libhiveodbc_sb64.so
#> 5            /opt/rstudio-drivers/impala/bin/lib/libimpalaodbc_sb64.so
#> 6          /opt/rstudio-drivers/mongodb/bin/lib/libmongodbodbc_sb64.so
#> 7              /opt/rstudio-drivers/mysql/bin/lib/libmysqlodbc_sb64.so
#> 8          /opt/rstudio-drivers/netezza/bin/lib/libnetezzaodbc_sb64.so
#> 9            /opt/rstudio-drivers/oracle/bin/lib/liboracleodbc_sb64.so
#> 10   /opt/rstudio-drivers/postgresql/bin/lib/libpostgresqlodbc_sb64.so
#> 11 /opt/rstudio-drivers/redshift/bin/lib/libamazonredshiftodbc_sb64.so
#> 12   /opt/rstudio-drivers/salesforce/bin/lib/libsalesforceodbc_sb64.so
#> 13     /opt/rstudio-drivers/sqlserver/bin/lib/libsqlserverodbc_sb64.so
#> 14             /opt/rstudio-drivers/teradata/bin/lib/tdataodbc_sb64.so
options(odbc.drivers.filter = odbc::odbcListDrivers()[["name"]])
odbc::odbcListDrivers()
#> [1] name      attribute value    
#> <0 rows> (or 0-length row.names)

Before adding the odbc.drivers.filter option:
image

After running options(odbc.drivers.filter = odbc::odbcListDrivers()[["name"]]):
image

blairj09 and others added 4 commits April 22, 2019 15:26
@jimhester jimhester merged commit d28ae80 into r-dbi:master Nov 8, 2019
@jimhester
Copy link
Contributor

Thanks, I ended up adding two new options odbc.drivers_filter and odbc.drivers_keep to give a bit more flexibility in how to restrict the results.

Thanks a million!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants