Skip to content

Commit

Permalink
Netezza / custom odbcDataType (#847)
Browse files Browse the repository at this point in the history
* netezzaSQL: customize odbcDataType

* add missing file

* NEWS: update
  • Loading branch information
detule authored Sep 12, 2024
1 parent 5f51af7 commit 5a858ba
Show file tree
Hide file tree
Showing 6 changed files with 29 additions and 6 deletions.
1 change: 1 addition & 0 deletions DESCRIPTION
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,7 @@ Collate:
'driver-hive.R'
'driver-impala.R'
'driver-mysql.R'
'driver-netezza.R'
'driver-oracle.R'
'driver-postgres.R'
'driver-redshift.R'
Expand Down
1 change: 1 addition & 0 deletions NAMESPACE
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ exportClasses(HDB)
exportClasses(Hive)
exportClasses(Impala)
exportClasses(MySQL)
exportClasses(NetezzaSQL)
exportClasses(OdbcConnection)
exportClasses(OdbcDriver)
exportClasses(OdbcResult)
Expand Down
2 changes: 2 additions & 0 deletions NEWS.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
# odbc (development version)

* Netezza: Improved data type inference for character columns (#847).

* Added functions `odbcEditDrivers()`, `odbcEditSystemDSN()`, and
`odbcEditUserDSN()` to provide a shorthand for
`file.edit(odbcListConfig()[[i]])`. The helpers only support macOS and
Expand Down
16 changes: 16 additions & 0 deletions R/driver-netezza.R
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
#' @export
#' @rdname DBI-classes
setClass("NetezzaSQL", contains = "OdbcConnection")

#' @export
#' @rdname odbcDataType
#' @usage NULL
setMethod("odbcDataType", "NetezzaSQL",
function(con, obj, ...) {
switch_type(
obj,
character = varchar(obj),
callNextMethod(con, obj, ...)
)
}
)
7 changes: 4 additions & 3 deletions man/DBI-classes.Rd

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

8 changes: 5 additions & 3 deletions man/odbcDataType.Rd

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

0 comments on commit 5a858ba

Please sign in to comment.