From: Matt S Trout Date: Mon, 15 Oct 2012 21:20:02 +0000 (+0000) Subject: add slice stability requirement code X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=8b2c306b68d5196e693256deebbfe4c32786f8d4;p=dbsrgits%2FData-Query.git add slice stability requirement code --- diff --git a/lib/Data/Query/Renderer/SQL/Slice/FetchFirst.pm b/lib/Data/Query/Renderer/SQL/Slice/FetchFirst.pm index 1af7f78..466258b 100644 --- a/lib/Data/Query/Renderer/SQL/Slice/FetchFirst.pm +++ b/lib/Data/Query/Renderer/SQL/Slice/FetchFirst.pm @@ -15,6 +15,10 @@ sub _render_slice_limit { ]; } +sub slice_stability { + (offset => 'requires'); +} + sub _slice_type { 'FetchFirst' } sub _render_slice { diff --git a/lib/Data/Query/Renderer/SQL/Slice/FirstSkip.pm b/lib/Data/Query/Renderer/SQL/Slice/FirstSkip.pm index 2e966e4..7cd5534 100644 --- a/lib/Data/Query/Renderer/SQL/Slice/FirstSkip.pm +++ b/lib/Data/Query/Renderer/SQL/Slice/FirstSkip.pm @@ -4,6 +4,8 @@ use Moo::Role; my %handle = (limit => 'FIRST', offset => 'SKIP'); +sub slice_stability { } + sub _slice_order { qw(limit offset) } sub _render_slice { diff --git a/lib/Data/Query/Renderer/SQL/Slice/GenericSubquery.pm b/lib/Data/Query/Renderer/SQL/Slice/GenericSubquery.pm index 4caeabf..67b7b93 100644 --- a/lib/Data/Query/Renderer/SQL/Slice/GenericSubquery.pm +++ b/lib/Data/Query/Renderer/SQL/Slice/GenericSubquery.pm @@ -5,6 +5,10 @@ use Moo::Role; with 'Data::Query::Renderer::SQL::Slice::SubqueryRemap'; +sub slice_stability { + (limit => 'requires', offset => 'requires'); +} + sub _render_slice { my ($self, $dq) = @_; die "Slice's inner is not a Select" diff --git a/lib/Data/Query/Renderer/SQL/Slice/LimitOffset.pm b/lib/Data/Query/Renderer/SQL/Slice/LimitOffset.pm index 54ef3f7..71b5cf2 100644 --- a/lib/Data/Query/Renderer/SQL/Slice/LimitOffset.pm +++ b/lib/Data/Query/Renderer/SQL/Slice/LimitOffset.pm @@ -2,6 +2,8 @@ package Data::Query::Renderer::SQL::Slice::LimitOffset; use Moo::Role; +sub slice_stability { } + sub _render_slice { my ($self, $dq) = @_; [ ($dq->{from} ? $self->_render($dq->{from}) : ()), diff --git a/lib/Data/Query/Renderer/SQL/Slice/RowNum.pm b/lib/Data/Query/Renderer/SQL/Slice/RowNum.pm index 7b90fcf..9d05e61 100644 --- a/lib/Data/Query/Renderer/SQL/Slice/RowNum.pm +++ b/lib/Data/Query/Renderer/SQL/Slice/RowNum.pm @@ -5,6 +5,10 @@ use Moo::Role; with 'Data::Query::Renderer::SQL::Slice::SubqueryRemap'; +sub slice_stability { + (offset => 'check'); +} + sub _render_slice { my ($self, $dq) = @_; die "Slice's inner is not a Select" diff --git a/lib/Data/Query/Renderer/SQL/Slice/RowNumberOver.pm b/lib/Data/Query/Renderer/SQL/Slice/RowNumberOver.pm index c3f6764..47b65bc 100644 --- a/lib/Data/Query/Renderer/SQL/Slice/RowNumberOver.pm +++ b/lib/Data/Query/Renderer/SQL/Slice/RowNumberOver.pm @@ -6,6 +6,8 @@ use Moo::Role; with 'Data::Query::Renderer::SQL::Slice::SubqueryRemap'; +sub slice_stability { } + sub _render_slice { my ($self, $dq) = @_; die "Slice's inner is not a Select"