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-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=68525dce9e7ae3020d287af3f3f41a351c061232;hp=abf130017ed6431f7455a58ada8e6d599a1d16fb;p=scpubgit%2FQ-Branch.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;