From: Matt S Trout Date: Mon, 16 Apr 2012 07:11:08 +0000 (+0000) Subject: slice type X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=951e88067d04567461a4a6cffd18d2339cb3d8f9;p=dbsrgits%2FData-Query.git slice type --- diff --git a/lib/Data/Query/Constants.pm b/lib/Data/Query/Constants.pm index 2aa9100..eb5cd1b 100644 --- a/lib/Data/Query/Constants.pm +++ b/lib/Data/Query/Constants.pm @@ -18,6 +18,7 @@ use constant +{ DQ_UPDATE => 'Update', DQ_INSERT => 'Insert', DQ_GROUP => 'Group', + DQ_SLICE => 'Slice', )) }; diff --git a/lib/Data/Query/Renderer/SQL/SQLite.pm b/lib/Data/Query/Renderer/SQL/SQLite.pm new file mode 100644 index 0000000..4dac236 --- /dev/null +++ b/lib/Data/Query/Renderer/SQL/SQLite.pm @@ -0,0 +1,18 @@ +package Data::Query::Renderer::SQL::SQLite; + +use Moo; + +extends 'Data::Query::Renderer::SQL::Naive'; + +sub _render_slice { + my ($self, $dq) = @_; + [ ($dq->{from} ? $self->_render($dq->{from}) : ()), + $self->_format_keyword('LIMIT'), $self->_render($dq->{limit}), + ($dq->{offset} + ? ($self->_format_keyword('OFFSET'), $self->_render($dq->{offset})) + : () + ), + ]; +} + +1;