[R-sig-DB] DBI preferred syntax

Hadley Wickham h@w|ckh@m @end|ng |rom gm@||@com
Sun Oct 12 15:59:49 CEST 2014


>> * dbConnect(RSQLite::SQLite(), "test") - this is the best way in my
>> opinion. It doesn't require that RSQLite be attached, just DBI, which
>> I think is the right approach. A DBI backend (in general) should only
>> ever provide methods, not new generics, so it shouldn't need to be
>> attached. In other words, you should _never_ need require("RSQLite").
>
> I agree with that as a general guideline.
>
> It might be worth considering that some backends may implement backend specific functionality. While that brings it out of line of DBI, it always bums me out to not have a way to escape the lowest common denominator functionality.  So perhaps there are cases for directly requiring a backend?

Right - you shouldn't have to require a backend, but you might want
to. (Also I think it would be good for custom backend functions to be
named like sqliteFunction rather than dbFunction, to make it more
clear to the user that they're extensions)

Hadley

-- 
http://had.co.nz/




More information about the R-sig-DB mailing list