benvanstaveren / Mojolicious-Plugin-Database

"proper" handling of DBI based connections in Mojolicious
http://search.cpan.org/dist/Mojolicious-Plugin-Database/
9 stars 3 forks source link

Documentation: Need example how to use it with ORM #5

Closed shmuelfomberg closed 9 years ago

shmuelfomberg commented 9 years ago

Because most of the people will want to use an ORM instead of plain DBI. I suppose that I should define a wrapping helper, that initialize the ORM over the dbh. If I understand correctly, this module uses DBI's connection-polling, and just try to reopen the connection every time it is needed. So the ORM should be initialized over it every time?

benvanstaveren commented 9 years ago

Hi Shmuel,

Actually it's not meant for use with an ORM, the goal of the plugin initially was to demonstrate how you can have DBI operating inside Hypnotoad (which forks), and apparently people have been using it for their projects; there are a few derivative plugins that let you use DBIx::Class in a similar fashion. Take a look on metacpan.org - I can't remember the proper name off-hand :)

On 11/03/2014 06:01 PM, Shmuel Fomberg wrote:

Because most of the people will want to use an ORM instead of plain DBI. I suppose that I should define a wrapping helper, that initialize the ORM over the dbh. If I understand correctly, this module uses DBI's connection-polling, and just try to reopen the connection every time it is needed. So the ORM should be initialized over it every time?


Reply to this email directly or view it on GitHub: https://github.com/benvanstaveren/Mojolicious-Plugin-Database/issues/5