Skip to content
Prev 13353 / 21307 Next

[Bioc-devel] dbApply name collision, RMySQL and RPostgreSQL, no direct call to either

Hi Paul,

trena imports RMySQL and RPostgreSQL. Both packages define and export
dbApply() so by importing all the symbols from both packages you get a
name clash. You can get around this by importing only the things you
need. It seems that you only call the following generic functions in
trena:

   dbConnect
   dbListTables
   dbGetQuery
   dbListConnections
   dbDisconnect

These are S4 generic functions that are defined in the DBI package so
they should be imported from there. Also import the corresponding
methods defined in RMySQL and RPostgreSQL. Your NAMESPACE file will
look something like this:

importFrom(DBI,
     dbConnect,
     dbListTables,
     dbGetQuery,
     dbListConnections,
     dbDisconnect)


importMethodsFrom(RMySQL,
     dbConnect,
     dbListTables,
     dbGetQuery,
     dbListConnections,
     dbDisconnect)

importMethodsFrom(RPostgreSQL,
     dbConnect,
     dbListTables,
     dbGetQuery,
     dbListConnections,
     dbDisconnect)

BTW have you considered using RMariaDB instead of RMySQL?

   https://cran.r-project.org/web/packages/RMariaDB/

Cheers,
H.
On 04/23/2018 11:12 AM, Paul Shannon wrote: