Re: [Dbix-class] Detecting connection errors

2015-10-14 Thread David Ihnen
I think we did something silly like doing a meaningless select/ping type operation just to make sure everything was cool in the DBIx application I worked on years ago. There may be a better answer these days though? David On Wed, Oct 14, 2015 at 12:53 PM, Alberto Luaces wrote:

[Dbix-class] Detecting connection errors

2015-10-14 Thread Alberto Luaces
Hi, I stumped over a problem when learning to use DBIx::Class. I had a typo on the filename holding the database, but no exception was thrown until I wanted to retrieve some results, which was not intuitive for me. How do you check for a successful connection? --8<---cut

Re: [Dbix-class] Detecting connection errors

2015-10-14 Thread Dagfinn Ilmari Mannsåker
Alberto Luaces writes: > Hi, > > I stumped over a problem when learning to use DBIx::Class. I had a typo > on the filename holding the database, but no exception was thrown until > I wanted to retrieve some results, which was not intuitive for me. How > do you check for a

[Dbix-class] Creating Result and ResultSet classes with Moo?

2015-10-14 Thread Robert Rothenberg
Hi All, Is there a way to declare Result and ResultSet classes using Moo? Specifically, I'm looking for something that provides functions for declaring columns, e.g. has_column id => ( isa => Int, autoincrement => 1, ); I'm aware of DBIx::Class::MooseColumns, but that uses Moose.

Re: [Dbix-class] Detecting connection errors

2015-10-14 Thread Alberto Luaces
ilm...@ilmari.org (Dagfinn Ilmari Mannsåker) writes: > Alberto Luaces writes: > >> Hi, >> >> I stumped over a problem when learning to use DBIx::Class. I had a typo >> on the filename holding the database, but no exception was thrown until >> I wanted to retrieve some results,

Re: [Dbix-class] Creating Result and ResultSet classes with Moo?

2015-10-14 Thread Dmitry L.
If you just need "moosefied" declaration syntax, then look DBIx::Class::Candy secondary API https://metacpan.org/pod/DBIx::Class::Candy#SECONDARY-API On 14 October 2015 at 21:10, Robert Rothenberg wrote: > Hi All, > > Is there a way to declare Result and ResultSet classes using

Re: [Dbix-class] Detecting connection errors

2015-10-14 Thread Alberto Luaces
Alberto Luaces writes: >> Sencondly, DBIx::Class only hits the database when it absolutely has >>to, >> e.g. to fetch restults. This includes the initial connection. However, >> you can force it to connect early by calling >> >>$schema->storage->ensure_connected; >> >>