On Fri, Nov 30, 2001 at 12:29:20PM +0000, Jacqui Caren wrote: > > > Tim, > I find myself writing a do_cached method quite often. > > Given this should be identical to the do algorithm > except that prepare_cached is used, would you consider > addng do_cached to the DBI API?
I'm aware of the issue but it is a tricky one. I'm going to have to think it through as the DBI's getting a preparse() method that can do (limited but useful) rewriting of SQL statements and that'll need to be plumbed-in somehow. > Thanks, > Jacqui > > p.s. > Thinking about this I wondered if it would have been > better to have a Cache_connection attribute passed > to prepare and do etc rather than have _cached > functions - I know there are pros and cons for both > techniques but the prior would allow enabling of > caching at execute time whereas the latter > requires a 'nasty' if or (horrors) eval :-) No eval required: $h->$method_name(...). But there are sub-classing / overloading / backwards compatibility issues etc with the attribute approach. Tim.