From: Matt S Trout Date: Sun, 14 Apr 2019 19:58:05 +0000 (+0000) Subject: demonstrate adding clauses with no special expand/render X-Git-Tag: v2.000000~3^2~239 X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=b77d646af13e3da81ab21744142825556c0c36a1;p=dbsrgits%2FSQL-Abstract.git demonstrate adding clauses with no special expand/render --- diff --git a/xt/clauses.t b/xt/clauses.t index 4d6a219..e6268ea 100644 --- a/xt/clauses.t +++ b/xt/clauses.t @@ -142,4 +142,22 @@ is_same_sql( q{SELECT * FROM foo WHERE id = (SELECT MAX(id) FROM foo)}, ); +{ + local $sqlac->{clauses_of}{select} = [ + @{$sqlac->{clauses_of}{select}}, qw(limit offset) + ]; + + ($sql, @bind) = $sqlac->select({ + select => '*', + from => 'foo', + limit => 10, + offset => 20, + }); + + is_same_sql_bind( + $sql, \@bind, + q{SELECT * FROM foo LIMIT ? OFFSET ?}, [ 10, 20 ] + ); +} + done_testing;