[Bast-commits] r4570 - SQL-Abstract/1.x/branches/cleanup
groditi at dev.catalyst.perl.org
groditi at dev.catalyst.perl.org
Fri Jul 11 22:16:33 BST 2008
Author: groditi
Date: 2008-07-11 22:16:33 +0100 (Fri, 11 Jul 2008)
New Revision: 4570
Added:
SQL-Abstract/1.x/branches/cleanup/test.pl
Log:
i do not deserve to have friends
Added: SQL-Abstract/1.x/branches/cleanup/test.pl
===================================================================
--- SQL-Abstract/1.x/branches/cleanup/test.pl (rev 0)
+++ SQL-Abstract/1.x/branches/cleanup/test.pl 2008-07-11 21:16:33 UTC (rev 4570)
@@ -0,0 +1,46 @@
+use SQL::Abstract2;
+
+my $bind_vars = [];
+my $q = SQL::Abstract2->new;
+
+my $test_struct =
+ [-select =>
+ [-fields =>
+ [-name => qw/table1 field1/],
+ [-name => qw/table1 field2/],
+ [-name => qw/table2 field3/],
+ ],
+ [-from => ( [-name => 'schema', 'table1'],
+ [-name => 'schema', 'table1', [-as => 'table2'] ],
+ ['-left join' =>
+ [-name => 'schema', 'table2', [-as => 'table3'] ],
+ [-on => [ -and => ( ['=', ( [-name => 'table1', 'fielda'],
+ [-name => 'table2', 'fielda'] ) ],
+ ['=', ( [-name => 'table1', 'fielda'],
+ [-name => 'table2', 'fielda'] ) ],
+ ),
+ ],
+ ],
+ ],
+ )
+ ],
+ [-where => [-and => [-and => ( ['<' => ( [-name => qw/table1 field1/],
+ [-date_sub => ['-curr_date'], qw/15 DAY/]
+ ),
+ ],
+ ['!=' => [-name => 'field3'], [-value => undef] ],
+ ['=' => [-name => 'field4'], [-value => 500] ],
+ ),
+ ],
+ [-or => ( [-in => [-name => 'field5'], [-value => 100], [-value => 100]],
+ [-between => [-name => 'field6'], [-value => 12], [-value => 26]]
+ ),
+ ],
+ ],
+ ],
+ [-'group by' => [-name => 'field4']],
+ [-'order by' => [-asc => [-name => 'field3']] ],
+ [-'limit' => [-value => 30], [-value => 100]],
+ ];
+
+print $q->handle_op($test_struct);
More information about the Bast-commits
mailing list