Beefy Boxes and Bandwidth Generously Provided by pair Networks
Syntactic Confectionery Delight
 
PerlMonks  

Re: Selecting date using DBIx::Class and InflateColumn

by friedo (Prior)
on Jul 11, 2008 at 20:20 UTC ( #697074=note: print w/replies, xml ) Need Help??


in reply to Selecting date using DBIx::Class and InflateColumn

The problem is that you're using qw in the list that you're passing to add_columns. What you're actually passing is the list ( 'id', 'token', 'old_invoice', 'date', '=>', '{data_type', '=>', \'datetime\'}' )

In order to pass a list of column-name => hashref pairs, you'll need to write it like this:

__PACKAGE__->add_columns(id => { }, token => { }, old_invoice => { }, date => {data_type => 'datetime'} );

Alternatively, you can pass a list of the plain column names (no hashrefs) and specify the date column type later:

__PACKAGE__->add_columns(qw/id token old_invoice/); __PACKAGE__->add_columns(date => {data_type => 'datetime'});

Update: Fixed typos

Replies are listed 'Best First'.
Re^2: Selecting date using DBIx::Class and InflateColumn
by nybble_1 (Novice) on Jul 11, 2008 at 22:11 UTC
    That was it

    Thanks Friendo

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://697074]
help
Chatterbox?
[marto]: I can relate to that somewhat, I'm a light sleeper and frequently get woken up by kids doing much the same as your cats
[jedikaiti]: Yea, the kids (& the cats) are good at that
talexb is having a hard time with Windows losing DNS info for Perlmonks when voting. CB works fine. Ugh.
[jedikaiti]: how odd

How do I use this? | Other CB clients
Other Users?
Others cooling their heels in the Monastery: (14)
As of 2017-07-25 15:14 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    I came, I saw, I ...
























    Results (374 votes). Check out past polls.