This repository has been archived by the owner on Apr 14, 2018. It is now read-only.
Releases: imanuelcostigan/RSQLServer
Releases · imanuelcostigan/RSQLServer
Version 0.3.0
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 forAsIs
objects and returnsNVARCHAR
andVARBINARY
SQL types with lengths of at least onedbHasCompleted()
returnsTRUE
for empty ResultSetsdbDisconnect()
returns a warning if called on a connection that is already closed and otherwise closes the connection and returnsTRUE
.dbGetInfo()
forSQLServerConnection
now complies withDBItest
expectationsdbGetInfo()
forSQLServerDriver
returns the JDBC driver version (3.0) asdriver.version
and jTDS verion asclient.version
instead of the jTDS client version andNA
respectively.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 (BEGIN
before andCOMMIT
after), and optionally much faster by way of thebatch
option.- Changed API for
dbWriteTable()
to match generic documented in the DBI package. It also now returnsTRUE
invisibly. dbWriteTable()
now fails when attempting to append to a temporary table (#75)- Implemented
dbSendStatement()
method which required the extension ofSQLServerResult
toSQLServerUpdateResult
the latter of which is used to dispatch thedbGetRowsAffected()
method (#95). Addedbatch
option to bothdbSendStatement()
anddbSendQuery()
for insert/update speedup (#69, #90, #106, @r2evans). - Implemented
dbBind()
method to replace the internal.fillStatementParameter()
method which required the extension ofSQLServerResult
toSQLServerPreResult
the 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., forINSERT
andUPDATE
)- Implemented
sqlCreateTable()
forSQLServerConnection
which is called bydb_create_table()
. (#76) dbDataType
maps R character objects of sufficiently long length toVARCHAR(MAX)
on newer version of MSSQL rather thanTEXT
as the latter is being deprecated.- Arguments of
dbConnect()
are nowNULL
where other default values were assigned. This does not change the behaviour of the method. - Introduced
pattern
argument 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 forSQLServerResult
has been removed and calls the default DBI method which callsdbHasCompleted()
,dbGetRowCount()
etc. The latter methods have been implemented forSQLServerResult
and are exported.dbIsValid()
implemented forSQLServerDriver
and 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 EXISTS
SQL clause if supported by SQL Server (#75)- New
temporary
argument todb_insert_into()
which overwrites existing table if set toTRUE
and if necessary. sql_select()
method supports theDISTINCT
keyword and includesTOP
keyword 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 defaultdplyr
methods.as.numeric()
andas.character()
calls now cast scalar input values to SQL typesFLOAT
andNVARCHAR(4000)
respectively rather thanNUMERIC
andTEXT
respectively (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:dbBind
for 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 returnsTRUE
in all instances rather thanFALSE
as 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.
Version 0.2.0
Major changes
- Implements a SQL backend to dplyr (#4) including SQL translations for as.POSIXct and as.Date (#43)
dbConnect()
interface has been enhanced but breaks backward compatibility consequently enhanced. Server details can be specified in a YAML file which are passed to dbConnect. See?SQLServer
(#8)
Enhancements
fetch()
now processes the data frame returned byRJDBC::fetch()
to better map database field types to their equivalents in R such as integer, logical, Date, POSIXct and raw. (#31, #47)dbWriteTable()
can now write Date, POSIXct and other non-character and non-numeric field types to equivalent SQL representations (#32)
Other changes
Version 0.1.1
- implemented and exported dbIsValid methods for SQLServerConnection and SQLServerResult (#1)
Version 0.1
- Initial release