Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion DESCRIPTION
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
Package: odbc
Title: Connect to ODBC Compatible Databases (using the DBI Interface)
Version: 1.5.0.9000
Version: 1.6.0
Authors@R: c(
person("Jim", "Hester", role = "aut"),
person("Hadley", "Wickham", , "[email protected]", role = c("aut", "cre")),
Expand Down
83 changes: 39 additions & 44 deletions NEWS.md
Original file line number Diff line number Diff line change
@@ -1,58 +1,53 @@
# odbc (development version)
# odbc 1.6.0

* `snowflake()` now allows passing `uid` without `pwd` when
using `authenticator = "SNOWFLAKE_JWT"` (@simonpcouch, #889).
## New features

* Enable automatic discovery of SQL Server drivers installed with homebrew
on ARM macOS (@stevecondylios, #893).

* SQL Server: Fix roundtrip of `hms` data.

* SQL Server: Fix data truncation when writing to temp tables with
`FreeTDS` (#866).

* SQL Server: Writing to DATETIME2 targets respects precision (#793).

* Addressed issue where error messages rethrown from some drivers would be
garbled when the raw error message contained curly brackets
(#859 by @simonpcouch).

* snowflake: Runtime driver configuration checks on `MacOS` (#857).

* Separate column content and name encoding by adding
a new `name_encoding` argument to `dbConnect` to complement
the existing `encoding` parameter (#845).

* Netezza: Improved data type inference for character and boolean
columns (#847, #850).
* A hex logo has been added to the package (@edgararuiz, #824).

* Added functions `odbcEditDrivers()`, `odbcEditSystemDSN()`, and
`odbcEditUserDSN()` to provide a shorthand for
`file.edit(odbcListConfig()[[i]])`. The helpers only support macOS and
Linux and will raise an error on Windows (@simonpcouch, #827).
* `databricks()` and `snowflake()` detect viewer-based credentials on
Posit Connect (@atheriel, #853 and #894).

* Trailing slashes are now automatically removed from `databricks(workspace)`,
guarding users from an uninformative driver message (@simonpcouch, #827).

* `snowflake()` now allows passing `uid` without `pwd` when
`authenticator = "externalbrowser"` (@simonpcouch, #817).
* `odbcEditDrivers()`, `odbcEditSystemDSN()`, and `odbcEditUserDSN()`
create shortcuts for `file.edit(odbcListConfig()[[i]])` on macOS and
Linux (@simonpcouch, #827).

* New `redshift()` helper simplifies connections to Amazon Redshift clusters,
particularly with IAM credentials (@atheriel, #879).

## Bug fixes and minor improvements

* DB2: Better support for temp tables in `dbListTables`, and `dbExistsTable` (#823).
* Error messages rethrown from drivers no longer become garbled when raw messages
contain curly brackets (@simonpcouch, #859).

* SQL Server drivers installed with homebrew are now discovered automatically
on ARM macOS (@stevecondylios, #893).

* `dbConnect(odbc(), ...)` will now error informatively if the package
can't locate a unixODBC install on MacOS and Linux (@simonpcouch, #782).
* `databricks(workspace)` removes trailing slashes automatically, preventing
uninformative driver messages (@simonpcouch, #827).

* Added a hex logo for the package (@edgararuiz, #824).
* `dbConnect()` displays clear errors when unixODBC isn't found on macOS and
Linux (@simonpcouch, #782).

* oracle: Fix writing to DATE and TIMESTAMP(n) targets using `batch_size` > 1.
* `dbConnect()` adds `name_encoding` to complement `encoding` for separate
column content and name encoding (#845).

* `dbListTables()` and `dbExistsTable()` improve temp table support with DB2 (#823).

* SQL Server: Fix issue related to writing when using SIMBA drivers (#816).
* Netezza character and boolean columns receive improved data type
inference (#847, #850).

* Oracle `DATE` and `TIMESTAMP(n)` targets handle writes correctly with
`batch_size > 1` (#810).

* `snowflake()` checks runtime driver configuration on macOS (#857).

* `snowflake()` and `databricks()` now detect viewer-based credentials when
running on Posit Connect (@atheriel, #853 and #894).
* `snowflake()` accepts `uid` without `pwd` when using
`authenticator = "externalbrowser"` or `authenticator = "SNOWFLAKE_JWT"`
(@simonpcouch, #817 and #889).

* A new `redshift()` helper greatly simplifies connecting to Amazon Redshift
clusters, particularly when using IAM credentials (@atheriel, #879).
* Resolved SQL Server data truncation in temp tables with `FreeTDS` (#866),
writing issues with SIMBA drivers (#816), `hms` data roundtrip (#887),
and precision when writing to `DATETIME2` targets (#793).

# odbc 1.5.0

Expand Down
6 changes: 4 additions & 2 deletions R/dbi-connection.R
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,8 @@ setMethod("show", "OdbcConnection",


#' @rdname OdbcConnection
#' @param dbObj An object inheriting from `DBIObject`, i.e. `DBIDriver`,
#' `DBIConnection`, or a `DBIResult`.
#' @inheritParams DBI::dbIsValid
#' @export
setMethod("dbIsValid", "OdbcConnection",
Expand Down Expand Up @@ -107,8 +109,8 @@ setMethod("dbExecute", c("OdbcConnection", "character"),

#' @rdname OdbcConnection
#' @inheritParams DBI::dbSendStatement
#' @param params Query parameters to pass to [dbBind()].
#' See [dbBind()] for details.
#' @param params Query parameters to pass to [DBI::dbBind()].
#' See [DBI::dbBind()] for details.
#' @export
setMethod("dbSendStatement", c("OdbcConnection", "character"),
function(conn, statement, params = NULL, ..., immediate = FALSE) {
Expand Down
7 changes: 4 additions & 3 deletions R/dbi-driver.R
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ setMethod("show", "OdbcDriver",
#' the driver does not return a valid value, it can be set manually with this
#' parameter.
#' @param attributes A list of connection attributes that are passed
#' prior to the connection being established. See \link{ConnectionAttributes}.
#' prior to the connection being established. See [ConnectionAttributes].
#' @param interruptible Logical. If `TRUE` calls to `SQLExecute` and
#' `SQLExecuteDirect` can be interrupted when the user sends SIGINT ( ctrl-c ).
#' Otherwise, they block. Defaults to `TRUE` in interactive sessions, and
Expand Down Expand Up @@ -142,8 +142,9 @@ setMethod("show", "OdbcDriver",
#' driver to create a connection object.
#' 3) *Interface with connections*: The resulting connection object can be
#' passed to various functions to retrieve information on database
#' structure ([dbListTables()]), iteratively develop queries ([dbSendQuery()],
#' [dbColumnInfo()]), and query data objects ([dbFetch()]).
#' structure ([DBI::dbListTables()][]), iteratively develop queries
#' ([DBI::dbSendQuery()], [DBI::dbColumnInfo()]), and query data objects
#' ([DBI::dbFetch()]).
#'
#' @aliases dbConnect odbc
#'
Expand Down
2 changes: 2 additions & 0 deletions R/dbi-result.R
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,8 @@ setMethod("dbHasCompleted", "OdbcResult",
)

#' @rdname OdbcResult
#' @param dbObj An object inheriting from `DBIObject`, i.e. `DBIDriver`,
#' `DBIConnection`, or a `DBIResult`.
#' @inheritParams DBI::dbIsValid
#' @export
setMethod("dbIsValid", "OdbcResult",
Expand Down
3 changes: 1 addition & 2 deletions R/dbi-table.R
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,7 @@ NULL

#' Convenience functions for reading/writing DBMS tables
#'
#' @param conn a \code{\linkS4class{OdbcConnection}} object, produced by
#' [DBI::dbConnect()]
#' @param conn An [OdbcConnection] object, produced by [DBI::dbConnect()].
#' @param name a character string specifying a table name. Names will be
#' automatically quoted so you can use any sequence of characters, not
#' just any valid bare table name.
Expand Down
8 changes: 4 additions & 4 deletions R/odbc-connection.R
Original file line number Diff line number Diff line change
Expand Up @@ -225,18 +225,18 @@ NULL
#' @description
#' `r lifecycle::badge("deprecated")`
#'
#' This function has been deprecated in favor of [dbListFields()].
#' This function has been deprecated in favor of [DBI::dbListFields()].
#'
#' For a given table this function returns detailed information on
#' all fields / columns. The expectation is that this is a relatively thin
#' wrapper around the ODBC `SQLColumns` function call, with some of the field
#' names renamed / re-ordered according to the return specifications below.
#'
#' @details
#' In [dbWriteTable()] we make a call to this method
#' In [DBI::dbWriteTable()] we make a call to this method
#' to get details on the fields of the table we are writing to. In particular
#' the columns `data_type`, `column_size`, and `decimal_digits` are used. An
#' implementation is not necessary for [dbWriteTable()] to work.
#' implementation is not necessary for [DBI::dbWriteTable()] to work.
#'
#' `odbcConnectionColumns` is routed through the `SQLColumns` ODBC
#' method. This function, together with remaining catalog functions
Expand All @@ -256,7 +256,7 @@ NULL
#' table name.
#'
#' @seealso The ODBC documentation on
#' [SQLColumns](https://docs.microsoft.com/en-us/sql/odbc/reference/syntax/sqlcolumns-function)
#' [SQLColumns](https://learn.microsoft.com/en-us/sql/odbc/reference/syntax/sqlcolumns-function)
#' for further details.
#'
#' @return data.frame with columns
Expand Down
2 changes: 2 additions & 0 deletions R/odbc-package.R
Original file line number Diff line number Diff line change
Expand Up @@ -12,3 +12,5 @@
#' @useDynLib odbc, .registration = TRUE
## usethis namespace: end
NULL

utils::globalVariables(c("attribute", "name", "simba_config_dirs"))
2 changes: 1 addition & 1 deletion R/odbc.R
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
#'
#' @param levels One or more of `r odbc:::choices_rd(names(odbc:::transactionLevels()))`.
#' @inheritParams DBI::dbDisconnect
#' @seealso <https://docs.microsoft.com/en-us/sql/odbc/reference/develop-app/setting-the-transaction-isolation-level>
#' @seealso <https://learn.microsoft.com/en-us/sql/odbc/reference/develop-app/setting-the-transaction-isolation-level>
#' @export
#' @examples
#' \dontrun{
Expand Down
6 changes: 2 additions & 4 deletions cran-comments.md
Original file line number Diff line number Diff line change
@@ -1,12 +1,10 @@
## R CMD check results

Recent MacOS builds have trigger the NOTE "installed size is 10.8Mb." MacOS builds include all debug symbols and CRAN policy doesn't permit building without them.

"Additional issues" checks on M1 Mac surface a number of new warnings related to GCC SQL/ODBC deprecations resulting from `sys-iodbc` headers overwriting `unixodbc` headers in `R-macos/recipes` (see https://github.com/R-macos/recipes/issues/41 and linked issues).
Recent MacOS builds trigger the NOTE "installed size is 10.8Mb." MacOS builds include all debug symbols and CRAN policy doesn't permit building without them.

## revdepcheck results

We checked 32 reverse dependencies, comparing R CMD check results across CRAN and dev versions of this package.
We checked 35 reverse dependencies, comparing R CMD check results across CRAN and dev versions of this package.

* We saw 0 new problems
* We failed to check 0 packages
Expand Down
3 changes: 1 addition & 2 deletions man/DBI-tables.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

13 changes: 6 additions & 7 deletions man/OdbcConnection.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions man/OdbcDriver.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

7 changes: 3 additions & 4 deletions man/OdbcResult.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

13 changes: 13 additions & 0 deletions man/SQLServer.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions man/databricks.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 3 additions & 2 deletions man/dbConnect-OdbcDriver-method.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions man/dbListTables-OdbcConnection-method.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions man/driver-Snowflake.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion man/odbc-package.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading
Loading