LimitXY Slice dialect
Matt S Trout [Thu, 21 Mar 2013 03:20:49 +0000 (03:20 +0000)]
lib/Data/Query/Renderer/SQL/Slice/LimitXY.pm [new file with mode: 0644]

diff --git a/lib/Data/Query/Renderer/SQL/Slice/LimitXY.pm b/lib/Data/Query/Renderer/SQL/Slice/LimitXY.pm
new file mode 100644 (file)
index 0000000..f1cf05b
--- /dev/null
@@ -0,0 +1,20 @@
+package Data::Query::Renderer::SQL::Slice::LimitXY;
+
+use Moo::Role;
+
+sub slice_subquery { }
+
+sub slice_stability { }
+
+sub _render_slice {
+  my ($self, $dq) = @_;
+  [ ($dq->{from} ? $self->_render($dq->{from}) : ()),
+    $self->_format_keyword('LIMIT'),
+    ($dq->{offset}
+      ? ($self->_render($dq->{offset}), ',')
+      : ()),
+    $self->_render($dq->{limit}),
+  ];
+}
+
+1;