From: Matt S Trout Date: Thu, 21 Mar 2013 03:01:02 +0000 (+0000) Subject: add slice_subquery method for DBIC introspection X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=fbf38b8eca52ee815784a98be806e0d7d0050e8b;p=dbsrgits%2FData-Query.git add slice_subquery method for DBIC introspection --- diff --git a/lib/Data/Query/Renderer/SQL/Slice/FetchFirst.pm b/lib/Data/Query/Renderer/SQL/Slice/FetchFirst.pm index f2741d6..3cea06e 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_subquery { + (offset => 1); +} + sub slice_stability { (offset => 'requires'); } diff --git a/lib/Data/Query/Renderer/SQL/Slice/FirstSkip.pm b/lib/Data/Query/Renderer/SQL/Slice/FirstSkip.pm index 7cd5534..e4a7656 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_subquery { } + sub slice_stability { } sub _slice_order { qw(limit offset) } diff --git a/lib/Data/Query/Renderer/SQL/Slice/GenericSubquery.pm b/lib/Data/Query/Renderer/SQL/Slice/GenericSubquery.pm index c10a890..eb83c4c 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_subquery { + (limit => 1, offset => 1); +} + sub slice_stability { (limit => 'requires', offset => 'requires'); } diff --git a/lib/Data/Query/Renderer/SQL/Slice/LimitOffset.pm b/lib/Data/Query/Renderer/SQL/Slice/LimitOffset.pm index 71b5cf2..0aed80a 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_subquery { } + sub slice_stability { } sub _render_slice { diff --git a/lib/Data/Query/Renderer/SQL/Slice/RowNum.pm b/lib/Data/Query/Renderer/SQL/Slice/RowNum.pm index 9d05e61..06e46e7 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_subquery { + (limit => 1, offset => 1); +} + sub slice_stability { (offset => 'check'); } diff --git a/lib/Data/Query/Renderer/SQL/Slice/RowNumberOver.pm b/lib/Data/Query/Renderer/SQL/Slice/RowNumberOver.pm index 4f27fc6..0ecd576 100644 --- a/lib/Data/Query/Renderer/SQL/Slice/RowNumberOver.pm +++ b/lib/Data/Query/Renderer/SQL/Slice/RowNumberOver.pm @@ -6,6 +6,10 @@ use Moo::Role; with 'Data::Query::Renderer::SQL::Slice::SubqueryRemap'; +sub slice_subquery { + (limit => 1, offset => 1); +} + sub slice_stability { } sub _render_slice {