The key point is that attributes passed to $drh->connect and
$dbh->prepare are applied to the new 'virgin' handle before the
real $dbh->connect or $sth->prepare is called. (In case that's not
clear, think about the $drh, $dbh, and $sth variables on those calls.)
I see. So if connect_cached() returns an existing handle, the
attributes would not be applied to it, yes?
Yes. The current attribute setting post-connect would be done
pre-connect so if the cached handle is okay it's returned unaltered.
You'd be most welcome to draw up an informal spec for some callbacks
(such as OnConnect and OnConnectCached) for discussion and
Should be pretty straight-forward. Are there other events for which
you'd like to add callbacks? OnPrepare, perhaps? OnExecute? OnFetch?
Yes, but let's just start with the connect ones for now.