[Dancer-users] New hooks and extensibility in Dancer::Plugin::Database
David Precious
davidp at preshweb.co.uk
Sat Feb 4 12:43:22 CET 2012
Hi all,
A developer version of Dancer::Plugin::Database went to CPAN last night
(1.70_01) with a few new features requested by Nick S. Knutov:
New hooks:
- database_connect_failed - fired when an attempt to connect to the
database fails
- database_connection_lost - fired when we realise that a database
handle is no longer usable (the connection went away)
- database_error - fired when any database error is raised by DBI
(implemented using DBI's HandleError, so it will catch all SQL
errors etc regardless of whether you were using D::P::D's
convenience methods or running your own queries direct).
Extensibility:
- New "handle_class" configuration option allows you to set which
class the handle will be blessed into, so you can subclass
Dancer::Plugin::Database::Handle and have handles blessed into your
subclass instead, so you can add your own custom features etc.
Please feel free to test the developer release if you have time,
feedback would be welcomed. Once I see decent CPAN testers results
come back, I'll get a new stable version out in the next few days.
Cheers
Dave P
--
David Precious ("bigpresh") <davidp at preshweb.co.uk>
http://www.preshweb.co.uk/ www.preshweb.co.uk/twitter
www.preshweb.co.uk/linkedin www.preshweb.co.uk/facebook
www.preshweb.co.uk/cpan www.preshweb.co.uk/github
More information about the Dancer-users
mailing list