wazzuteke has asked for the wisdom of the Perl Monks concerning the following question:
Where I am hunting to have the query return a boolean indicating whether or not 'date_column' is a date past right now. Simple enough it seems. That said, the ultimate question is: Any ideas of how to do this with DBIx::Class?SELECT column_name, ( date_column >= NOW() ) as condition FROM some_ +table;
Which is somewhat similar to how to run within the WHERE tuple condition, yet generates a query like the following (which is not syntactically correct):{ 'select' => { 'date_column' => { '>=', NOW(), } }, }
The best part? Even if it did generate the correct syntax, it also decided to uc() the column name. And, given I'm playing with MySQL, my column names are all case sensitive. Boo!SELECT column_name, DATE_COLUMN( >= ( NOW() ) ) as condition
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Conditions as named columns using DBIx::Class
by dragonchild (Archbishop) on Oct 31, 2008 at 19:33 UTC | |
by wazzuteke (Hermit) on Oct 31, 2008 at 20:11 UTC | |
|
Re: Conditions as named columns using DBIx::Class
by Narveson (Chaplain) on Oct 31, 2008 at 21:53 UTC |