odbc
odbc copied to clipboard
Export connection classes (or the `class_cache` env)
Issue Description and Expected Result
In a package, I'm trying to use S4 dispatch on one of the concrete connection classes ("Microsoft SQL Server"
). For this I need to provide a class "definition". Simply calling setOldClass()
does not do the trick as this is an actual S4 class provided by {odbc}. The only thing I got to work was doing
#' @importClassesFrom odbc OdbcConnection
setClass("Microsoft SQL Server", contains = "OdbcConnection",
where = odbc:::class_cache)
Is exporting the corresponding classes in the cards? Or maybe the class_cache
env?
Database
Any.
Reproducible Example
Happy to create one if helpful for making the issue clearer.
I am also having this problem.
@detule Do you have any information on this?
I don't see a problem with exporting the class cache environment. @hadley any reasons to keep it internal?
My baseline is to be very sceptical that exporting this internal implementation detail is a good idea in the long run.
I know that it's frustrating that we don't provide better support for this, but creating S4 classes dynamically is fundamentally fragile and I don't think it's good to build further upon it. I think the only real fix is to eventually switch from S4 to S7, but that is still some time away.