[dancer-users] random web page breakages

David Precious davidp at preshweb.co.uk
Wed Apr 29 15:26:11 BST 2015


On Tue, 28 Apr 2015 07:16:56 +0100
Andrew Solomon <andrew at geekuni.com> wrote:
> I'm a bit confused here. When should we use
> https://metacpan.org/pod/Dancer2::Plugin::Database and when should we
> use https://metacpan.org/pod/DBIx::Connector ?
> 
> Unless I've missed something it looks as though
> Dancer2::Plugin::Database doesn't depend on DBIx::Connector - what's
> the reason for that?

D::P::D is designed to:

* manage caching of handles, checking them and automatically
  reconnecting as needed, going to lengths to ensure fork/thread safety
* abstract out the reading of DB connection details from the app's
  config/environment config files (including supporting different named
  sets of details)
* add quick convenience methods to save the amount of SQL you need to
  write, making simple queries possible in pure-Perl without resorting
  to DBIC et al.

I could have used DBIx::Connector to handle the connecting part, but it
was just as easy to implement it myself, without adding an additional
prereq - I didn't see the need for DBIx::Connector given that I was
writing all the logic to safely cache connection handles etc anyway.



-- 
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