This repository was archived by the owner on Apr 14, 2018. It is now read-only.
DBI backend
A number of changes have been made to improve DBI compliance as specified by tests in the DBItest package (#60):
fetch()on non-query statements return an empty data frame- Nested transactions throw errors with related change of
dbWriteTable()code now being wrapped indbWithTransaction() dbDataType()works forAsIsobjects and returnsNVARCHARandVARBINARYSQL types with lengths of at least onedbHasCompleted()returnsTRUEfor empty ResultSetsdbDisconnect()returns a warning if called on a connection that is already closed and otherwise closes the connection and returnsTRUE.dbGetInfo()forSQLServerConnectionnow complies withDBItestexpectationsdbGetInfo()forSQLServerDriverreturns the JDBC driver version (3.0) asdriver.versionand jTDS verion asclient.versioninstead of the jTDS client version andNArespectively.SQLServer()no longer accepts arguments- Bumped DBI requirement
A number of other changes have been made to the DBI backend:
- Implemented
dbBegin(),dbCommit(),dbRollback()methods for DBI generics dbWriteTable()is faster by always using transactions (BEGINbefore andCOMMITafter), and optionally much faster by way of thebatchoption.- Changed API for
dbWriteTable()to match generic documented in the DBI package. It also now returnsTRUEinvisibly. dbWriteTable()now fails when attempting to append to a temporary table (#75)- Implemented
dbSendStatement()method which required the extension ofSQLServerResulttoSQLServerUpdateResultthe latter of which is used to dispatch thedbGetRowsAffected()method (#95). Addedbatchoption to bothdbSendStatement()anddbSendQuery()for insert/update speedup (#69, #90, #106, @r2evans). - Implemented
dbBind()method to replace the internal.fillStatementParameter()method which required the extension ofSQLServerResulttoSQLServerPreResultthe latter of which allows statements with bindings to present a ResultSet interface to DBI (ResultSets are only created after values are bound to parameterised statements in JDBC). (#88) dbBind()now supports multi-row binding (e.g., forINSERTandUPDATE)- Implemented
sqlCreateTable()forSQLServerConnectionwhich is called bydb_create_table(). (#76) dbDataTypemaps R character objects of sufficiently long length toVARCHAR(MAX)on newer version of MSSQL rather thanTEXTas the latter is being deprecated.- Arguments of
dbConnect()are nowNULLwhere other default values were assigned. This does not change the behaviour of the method. - Introduced
patternargument todbListTables()which allows you to list all tables matching a pattern. dbExistsTable()now passed table name todbListTables()as a pattern to be matched which should improve its performance.dbColumnInfo()succeeds in running (#96, @r2evans)dbGetInfo()method forSQLServerResulthas been removed and calls the default DBI method which callsdbHasCompleted(),dbGetRowCount()etc. The latter methods have been implemented forSQLServerResultand are exported.dbIsValid()implemented forSQLServerDriverand always returnsTRUE.- Now rely on DBI supplied
show()methods
dplyr/dbplyr backend
A number of changes were made to dplyr backend including a refactoring of its code across to the newer dbplyr package. As a result, dplyr >= 0.7.0 is required:
src_desc()defunct in favour ofdb_desc()- Implemented
db_create_table(),db_write_table()anddb_insert_into()forSQLServerConnection db_drop_table()supports theIF EXISTSSQL clause if supported by SQL Server (#75)- New
temporaryargument todb_insert_into()which overwrites existing table if set toTRUEand if necessary. sql_select()method supports theDISTINCTkeyword and includesTOPkeyword when query results are ordered.compute()andcopy_to()implementations are replaced bydb_compute()anddb_copy_to()implementationsdb_explain()is more informative (e.g. prints relative cost of operations)db_analyze()unsupported and simply returnsTRUE.db_query_fields()method for SQLServerConnection removed in favour of default dplyr method. The latter better handles sub-queries.intersect()andsetdiff()methods are removed in favour of defaultdplyrmethods.as.numeric()andas.character()calls now cast scalar input values to SQL typesFLOATandNVARCHAR(4000)respectively rather thanNUMERICandTEXTrespectively (default in dplyr).- Added basic testing of dplyr backend (#81)
RJDBC
This package no longer depends on RJDBC. As such a number of user visible changes have been made:
dbSendQuery()only executes queries rather than other arbitrary SQL statements. See rstats-db/DBI#20. It also no longer supports calling stored procedures (callable statements).dbSendQuery()can execute parameterised queries. See?DBI:dbBindfor more details on parameterised queries.dbSendUpdate()which was based on RJDBC's method and which executes non-query SQL statements will be deprecated in favour of the more descriptivedbExecute()which has been implemented upstream in DBI (the latter of which callsdbSendStatement()). See rstats-db/DBI#20. Unlike RJDBC'sdbSendUpdate(),dbExecute()does not yet support calling stored procedures as these do not seem to be explicitly supported by any other DBI backend.dbExecute()arguments have been changed to reflect the DBI generic.- Implemented
dbUnloadDriver()which returnsTRUEin all instances rather thanFALSEas was the case in RJDBC.
A number of previously imported RJDBC methods have now been reimplemented in this package with no user visible changes.
Other changes
- Added Travis-CI (#83, #84) and Appveyor support (#80, @Hong-Revo)
- Correctly determine major version of SQL Server DB backend (#122)
- dplyr's
arrange()method now returns whole result rather than top 100 rows (#124). This was implemented by changing the default behaviour ofsql_select()method and may result in breaks to existing code.