[Dbix-class] Explicit ASTs (ping nate)
Ash Berlin
ash at cpan.org
Sat Sep 2 23:54:35 CEST 2006
Ash Berlin wrote:
> Matt S Trout wrote:
>
>> SELECT my.a, my.b FROM my_table my WHERE spork = 1
>>
>> and that would become
>>
>> {
>> select => [ [ -name, 'my', 'a' ], [ -name, 'my', 'b' ] ],
>> from => [ [ -alias, 'my_table', 'my' ] ],
>> where => [ [ -op, '=', [ -name, 'spork' ], [ -bind, 1 ] ] ],
>> }
>>
>> which is ... spectacularly ugly, but I -think- explicit enough.
>>
> [snip]
>
> No kidding thats ugly. Would there be shortcuts for common operations
> (maybe just in DBIC, not SQL::A itself) such as just `select these
> cols'? such as:
>
> { select => [qw/a b/], ... }
>
> Ash
>
>
>
Ignore me - I missed the point (DWIM AST -> explicit AST -> SQL).
Personally I blame 22 hours of traveling and then not enough sleep.
More information about the Dbix-class
mailing list