-
Notifications
You must be signed in to change notification settings - Fork 159
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
New odbc method for sql.reader #145
Conversation
* As factors to false, to prevent loads of factors * Add tidyr to list of default packages
Added possible fields to the RODBC script. Script now looks through fields and includes in the odbcDriverConnect function if not blank.
This reverts commit 24a2bfe.
A more flexible odbc connection, allowing for variables to be left out of the .sql file. This could be further extended to run solely off the fields in the .sql file.
Documentation updated for separated.list
* Travis didn't like the period in the DESCRIPTION title * separated.list didn't have the correct link for odbcDriverConnect
…l` files. Arguments that are not specified take the default values from `RODBC::odbcDriverConnect`.
Better odbc
Typo...
Set defaults for colQuote and tabQuote to `RODBC::odbcDriverConnect` defaults. These can be set in the .sql file if required.
Fixed small bug - `sepchar` and `colchar` were inverted.
Minor bug preventing `colQuote` and `tabQuote` defaults from being overwritten.
Fixed a bug in the default assignment...
Thanks so much for this PR. I'm really looking forward to reviewing it and will clear some time over the net few days! |
@@ -61,8 +61,11 @@ | |||
#' dsn: sample_dsn | |||
#' user: sample_user | |||
#' password: sample_password | |||
#' dbname: sample_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.
Does changing dbname to database break backward compatibility?
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.
I think on reflection it does. It will also have an impact on the user, password and dsn fields. I'll fix this.
I really like querying the driver for its arguments and defaults. Really we should think about moving all of the connections to this method in the future. For maintenance, my biggest concern is backward compatibility with the change of dbname to database. While the ODBC driver expects a database argument this might just break some projects. Perhaps adding a method to set database to dbname if dbname is given plus a deprecation warning? To help our future selves, can you add a test illustrating using the new parameters for ODBC please. While there are existing tests for the ODBC drivers, they only exercise the old parameters and defaults. Adding a new test ensures that future changes to the code or to the ODBC drivers don't break the feature. Finally, can you squash into a single commit please. I appreciate having the commit history while working on the feature branch is invaluable, once merged into master it can make the master history difficult to read. Thanks for this PR -- it looks really great! |
Thanks for looking over it - much appreciated. I'll have some time later this week incorporate your comments |
1e74500
to
acf658b
Compare
Closing for now since it breaks backward compatibility. Please re-open if the backward compatibility issue is solved or there is a pressing need to break backward compatibility. |
Relates to Issue #144
Pulls through the default options for
RODBC::odbcDriverConnect
usingformals
. Args specified in the.sql
doc (withtype: odbc
) are compared to theformals
list. Those that areRODBC::odbcDriverConnect
args replace the defaults (withcheck.else.default
), while those that aren't (excludingtype
andquery
) are assumed to be values in theconnection
string. These remaining args are concatenated to form theconnection
string withseparated.list
.I've had to specify defaults for
colQuote
andtabQuote
. They were set to double quotes as suggested in theRODBC
documentation, although this can be changed in the .sql file withcolQuote:
andtabQuote:
if required.There is probably a more elegant way to do this, but this should be compatible with
.sql
files made in the old world (although this hasn't been tested).RStudio and
roxygen2
went a bit gangbusters with documentation updates. Let me know if that is an issue...Main changes:
sql.reader