ropensci / dittodb

dittodb: A Test Environment for DB Queries in R
https://dittodb.jonkeane.com/
Other
81 stars 15 forks source link

Better handle ODBC's connection classes #185

Open jonkeane opened 9 months ago

jonkeane commented 9 months ago

ODBC actually returns connections of classes that it defines itself. As of ODBC 1.4.2, not all of these are exported (e.g. PostgreSQL is the resultant class of the connection, but that is not exported (though it is on main)).

One can see how ODBC does this at https://github.com/r-dbi/odbc/blob/f5bf80dd23547d289332ba2c01c91b455e8e98de/R/odbc-connection.R#L57-L64

Could we (and should we) save the class during the capturing process and then construct the class from that when mock-connecting?

PR #184 works around the issue that triggered me to realize this by hardcoding the seemingly one thing that dbplyr uses dispatch for that class on.