5 use SQL::Abstract::Tree;
8 my $sqlat = SQL::Abstract::Tree->new({
9 fill_in_placeholders => 1,
10 placeholder_surround => [qw(; -)],
13 is($sqlat->fill_in_placeholder(['lolz']), q(;lolz-),
14 'placeholders are populated correctly'
19 my $sqlat = SQL::Abstract::Tree->new({
20 fill_in_placeholders => 1,
21 placeholder_surround => [qw(< >)],
24 is($sqlat->fill_in_placeholder(['station']), q(<station>),
25 'placeholders are populated correctly and in order'
31 my $sqlat = SQL::Abstract::Tree->new({
32 fill_in_placeholders => 1,
33 placeholder_surround => [qw(' ')],
36 is $sqlat->format('SELECT ? AS x, ? AS y FROM Foo WHERE t > ? and z IN (?, ?, ?) ', [qw/frew ribasushi 2008-12-12 1 2 3/]),
37 q[SELECT 'frew' AS x, 'ribasushi' AS y FROM Foo WHERE t > '2008-12-12' AND z IN ( '1', '2', '3' )], 'Complex placeholders work';