Skip to content
Prev 1333 / 1559 Next

dbWriteTable and dbReadTable generics

Hi,

I do agree that having row.names=, append=, and overwrite= makes sense,
because these arguments are common and quite natural to most current DBI
method implementations of these generic functions.  However, adding them
explicitly to the generic definition implies that methods can be dispatched
on the *class* of those same arguments, which I'm not clear whether it's
helpful.

Here, I seem to see two similar but not-quite equal objectives:

(1) defining an interface more strictly (i.e., the DBI dictates that
dbWriteTables, etc., must have a more complete signature including
row.names=, etc.). Perfectly reasonable, yet setMethod for the various
implementations may (?) need to be revised (if so, not a big a deal).

(2) defining the signature on which methods are be dispatched.

I don't think that (1) is wrong (after all, the current use of name= is
precisely this case) or that (1) and (2) are mutually exclusive. However,
the original intention was clearly (2): methods are to be dispatched only
on the conn= and name= arguments, other arguments (...) may be passed from
the generic to the method(s), but not used for dispatching.  I still feel
that the current definition expresses this intention most clearly and
unambigiously.  Adding row.names=, etc., for the sake of a more complete
interface may imply behavior we (I)  haven't anticipated, e.g., what error
do users get when they incorrectly supply "row.names = t" (t as the
transpose as opposed to T for TRUE)?  Overall, not a particular big issue.

My $0.02

Regards,

David
On Fri, Oct 18, 2013 at 7:12 PM, Seth Falcon <seth at userprimary.net> wrote: