On Fri, Sep 27, 2013 at 09:12:09AM +0100, Martin J. Evans wrote: > On 26/09/13 23:29, Tim Bunce wrote:
> >I'm expecting that one of the side-effects of DBIT will be a great > >improvement in support for get_info by drivers. That'll be a win for all. > > It definitely is a win. I can't even begin to tell you the pain I had > writing DBD neutral code just for ODBC, Oracle, DB2, mysql and > postgres. We persevered for some time but ended up with so much of the > class methods overridden we ended up with effectively 5 different > applications - although it did not look like it from the front. Once > you include the SQL as well - it really is not fun and although I > don't use DBIx::Class myself, it must be quite a piece of code. It > will be so much nicer to do: > if ($h->get_info(parameters_need_colons)) { > do this > } else { > do this > } > > than > > if ($h->{driver} eq 'Oracle' || $h->{driver} eq 'postres') blah blah So, Martin, would you be interested in starting a little side-project to propose an extension to the DBI spec for get_info()? It's likely that DBIT will feed into that work, but there's clearly a need beyond DBIT and you've clearly got (painful) experience to draw on :) I suggest drawing up a list of things you'd like get_info to provide info about (as you did informally in a recent email) then compare that list with the those provided by the ANSI/ODBC standard to see which are already covered. Somewhat independant of that, I'd like to identify a set of get_info items that we recommend all drivers define. Tim.