demonstrate adding clauses with no special expand/render
Matt S Trout [Sun, 14 Apr 2019 19:58:05 +0000 (19:58 +0000)]
xt/clauses.t

index 4d6a219..e6268ea 100644 (file)
@@ -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;