From: Peter Rabbitson Date: Sat, 20 Aug 2016 09:31:36 +0000 (+0200) Subject: Extract couple more stateless functions from DBIHacks (like 497d0451) X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=616ca57f8cd27f475da275bbef986fdd42d4069f;p=dbsrgits%2FDBIx-Class.git Extract couple more stateless functions from DBIHacks (like 497d0451) Zero functional changes --- diff --git a/lib/DBIx/Class/ResultSet.pm b/lib/DBIx/Class/ResultSet.pm index 920c713..a0305c8 100644 --- a/lib/DBIx/Class/ResultSet.pm +++ b/lib/DBIx/Class/ResultSet.pm @@ -14,6 +14,7 @@ use DBIx::Class::_Util qw( fail_on_internal_wantarray fail_on_internal_call UNRESOLVABLE_CONDITION ); use DBIx::Class::SQLMaker::Util qw( normalize_sqla_condition extract_equality_conditions ); +use DBIx::Class::ResultSource::FromSpec::Util 'find_join_path_to_alias'; BEGIN { # De-duplication in _merge_attr() is disabled, but left in for reference @@ -2220,6 +2221,7 @@ sub populate { # At this point assume either hashes or arrays my $rsrc = $self->result_source; + my $storage = $rsrc->schema->storage; if(defined wantarray) { my (@results, $guard); @@ -2228,7 +2230,7 @@ sub populate { # column names only, nothing to do return if @$data == 1; - $guard = $rsrc->schema->storage->txn_scope_guard + $guard = $storage->txn_scope_guard if @$data > 2; @results = map @@ -2238,7 +2240,7 @@ sub populate { } else { - $guard = $rsrc->schema->storage->txn_scope_guard + $guard = $storage->txn_scope_guard if @$data > 1; @results = map { $self->new_result($_)->insert } @$data; @@ -2452,13 +2454,13 @@ sub populate { ### start work my $guard; - $guard = $rsrc->schema->storage->txn_scope_guard + $guard = $storage->txn_scope_guard if $slices_with_rels; ### main source data # FIXME - need to switch entirely to a coderef-based thing, # so that large sets aren't copied several times... I think - $rsrc->schema->storage->_insert_bulk( + $storage->_insert_bulk( $rsrc, [ @$colnames, sort keys %$rs_data ], [ map { @@ -3269,13 +3271,11 @@ sub related_resultset { my $attrs = $self->_chain_relationship($rel); - my $storage = $rsrc->schema->storage; - # Previously this atribute was deleted (instead of being set as it is now) # Doing so seems to be harmless in all available test permutations # See also 01d59a6a6 and mst's comment below # - $attrs->{alias} = $storage->relname_to_table_alias( + $attrs->{alias} = $rsrc->schema->storage->relname_to_table_alias( $rel, $attrs->{seen_join}{$rel} ); @@ -3299,7 +3299,7 @@ sub related_resultset { # the top of the stack, and if not - make sure the chain is inner-joined down # to the root. # - my $switch_branch = $storage->_find_join_path_to_node( + my $switch_branch = find_join_path_to_alias( $attrs->{from}, $attrs->{alias}, ); diff --git a/lib/DBIx/Class/ResultSource.pm b/lib/DBIx/Class/ResultSource.pm index 0c0cb9d..ee5704f 100644 --- a/lib/DBIx/Class/ResultSource.pm +++ b/lib/DBIx/Class/ResultSource.pm @@ -22,6 +22,7 @@ use DBIx::Class::_Util qw( refdesc emit_loud_diag ); use DBIx::Class::SQLMaker::Util qw( normalize_sqla_condition extract_equality_conditions ); +use DBIx::Class::ResultSource::FromSpec::Util 'fromspec_columns_info'; use SQL::Abstract 'is_literal_value'; use Devel::GlobalDestruction; use Scalar::Util qw( blessed weaken isweak refaddr ); @@ -2285,7 +2286,6 @@ sub _resolve_relationship_condition { ; my $rel_rsrc = $self->related_source($args->{rel_name}); - my $storage = $self->schema->storage; if (exists $args->{foreign_values}) { @@ -2583,7 +2583,7 @@ sub _resolve_relationship_condition { # there is no way to know who is right and who is left in a cref # therefore a full blown resolution call, and figure out the # direction a bit further below - $colinfos ||= $storage->_resolve_column_info([ + $colinfos ||= fromspec_columns_info([ { -alias => $args->{self_alias}, -rsrc => $self }, { -alias => $args->{foreign_alias}, -rsrc => $rel_rsrc }, ]); diff --git a/lib/DBIx/Class/ResultSource/FromSpec/Util.pm b/lib/DBIx/Class/ResultSource/FromSpec/Util.pm new file mode 100644 index 0000000..47106d7 --- /dev/null +++ b/lib/DBIx/Class/ResultSource/FromSpec/Util.pm @@ -0,0 +1,140 @@ +package #hide from PAUSE + DBIx::Class::ResultSource::FromSpec::Util; + +use strict; +use warnings; + +use base 'Exporter'; +our @EXPORT_OK = qw( + fromspec_columns_info + find_join_path_to_alias +); + +use Scalar::Util 'blessed'; + +# Takes $fromspec, \@column_names +# +# returns { $column_name => \%column_info, ... } for fully qualified and +# where possible also unqualified variants +# also note: this adds -result_source => $rsrc to the column info +# +# If no columns_names are supplied returns info about *all* columns +# for all sources +sub fromspec_columns_info { + my ($fromspec, $colnames) = @_; + + return {} if $colnames and ! @$colnames; + + my $sources = ( + # this is compat mode for insert/update/delete which do not deal with aliases + ( + blessed($fromspec) + and + $fromspec->isa('DBIx::Class::ResultSource') + ) ? +{ me => $fromspec } + + # not a known fromspec - no columns to resolve: return directly + : ref($fromspec) ne 'ARRAY' ? return +{} + + : +{ + # otherwise decompose into alias/rsrc pairs + map + { + ( $_->{-rsrc} and $_->{-alias} ) + ? ( @{$_}{qw( -alias -rsrc )} ) + : () + } + map + { + ( ref $_ eq 'ARRAY' and ref $_->[0] eq 'HASH' ) ? $_->[0] + : ( ref $_ eq 'HASH' ) ? $_ + : () + } + @$fromspec + } + ); + + $_ = { rsrc => $_, colinfos => $_->columns_info } + for values %$sources; + + my (%seen_cols, @auto_colnames); + + # compile a global list of column names, to be able to properly + # disambiguate unqualified column names (if at all possible) + for my $alias (keys %$sources) { + ( + ++$seen_cols{$_}{$alias} + and + ! $colnames + and + push @auto_colnames, "$alias.$_" + ) for keys %{ $sources->{$alias}{colinfos} }; + } + + $colnames ||= [ + @auto_colnames, + ( grep { keys %{$seen_cols{$_}} == 1 } keys %seen_cols ), + ]; + + my %return; + for (@$colnames) { + my ($colname, $source_alias) = reverse split /\./, $_; + + my $assumed_alias = + $source_alias + || + # if the column was seen exactly once - we know which rsrc it came from + ( + $seen_cols{$colname} + and + keys %{$seen_cols{$colname}} == 1 + and + ( %{$seen_cols{$colname}} )[0] + ) + || + next + ; + + DBIx::Class::Exception->throw( + "No such column '$colname' on source " . $sources->{$assumed_alias}{rsrc}->source_name + ) unless $seen_cols{$colname}{$assumed_alias}; + + $return{$_} = { + %{ $sources->{$assumed_alias}{colinfos}{$colname} }, + -result_source => $sources->{$assumed_alias}{rsrc}, + -source_alias => $assumed_alias, + -fq_colname => "$assumed_alias.$colname", + -colname => $colname, + }; + + $return{"$assumed_alias.$colname"} = $return{$_} + unless $source_alias; + } + + \%return; +} + +sub find_join_path_to_alias { + my ($fromspec, $target_alias) = @_; + + # subqueries and other oddness are naturally not supported + return undef if ( + ref $fromspec ne 'ARRAY' + || + ref $fromspec->[0] ne 'HASH' + || + ! defined $fromspec->[0]{-alias} + ); + + # no path - the head *is* the alias + return [] if $fromspec->[0]{-alias} eq $target_alias; + + for my $i (1 .. $#$fromspec) { + return $fromspec->[$i][0]{-join_path} if ( ($fromspec->[$i][0]{-alias}||'') eq $target_alias ); + } + + # something else went quite wrong + return undef; +} + +1; diff --git a/lib/DBIx/Class/SQLMaker/Util.pm b/lib/DBIx/Class/SQLMaker/Util.pm index f029e24..430cc2b 100644 --- a/lib/DBIx/Class/SQLMaker/Util.pm +++ b/lib/DBIx/Class/SQLMaker/Util.pm @@ -346,7 +346,7 @@ sub _normalize_cond_unroll_pairs { if (ref $rhs eq 'HASH' and ! keys %$rhs) { # FIXME - SQLA seems to be doing... nothing...? } - # normalize top level -ident, for saner extract_fixed_condition_columns code + # normalize top level -ident, for saner extract_equality_conditions() code elsif (ref $rhs eq 'HASH' and keys %$rhs == 1 and exists $rhs->{-ident}) { push @conds, { $lhs => { '=', $rhs } }; } diff --git a/lib/DBIx/Class/Storage/DBI.pm b/lib/DBIx/Class/Storage/DBI.pm index 8d704bd..7be4202 100644 --- a/lib/DBIx/Class/Storage/DBI.pm +++ b/lib/DBIx/Class/Storage/DBI.pm @@ -11,6 +11,7 @@ use DBIx::Class::Carp; use Scalar::Util qw/refaddr weaken reftype blessed/; use Context::Preserve 'preserve_context'; use SQL::Abstract qw(is_plain_value is_literal_value); +use DBIx::Class::ResultSource::FromSpec::Util 'fromspec_columns_info'; use DBIx::Class::_Util qw( quote_sub perlstring serialize dump_value dbic_internal_try dbic_internal_catch @@ -1775,7 +1776,8 @@ sub _resolve_bindattrs { my $resolve_bindinfo = sub { #my $infohash = shift; - $colinfos ||= { %{ $self->_resolve_column_info($ident) } }; + # shallow copy to preempt autoviv + $colinfos ||= { %{ fromspec_columns_info($ident) } }; my $ret; if (my $col = $_[0]->{dbic_colname}) { diff --git a/lib/DBIx/Class/Storage/DBI/ADO/MS_Jet.pm b/lib/DBIx/Class/Storage/DBI/ADO/MS_Jet.pm index c7cb5c3..fbcd0ea 100644 --- a/lib/DBIx/Class/Storage/DBI/ADO/MS_Jet.pm +++ b/lib/DBIx/Class/Storage/DBI/ADO/MS_Jet.pm @@ -2,12 +2,15 @@ package DBIx::Class::Storage::DBI::ADO::MS_Jet; use strict; use warnings; + use base qw/ DBIx::Class::Storage::DBI::ADO DBIx::Class::Storage::DBI::ACCESS /; use mro 'c3'; + use DBIx::Class::Storage::DBI::ADO::CursorUtils '_normalize_guids'; +use DBIx::Class::ResultSource::FromSpec::Util 'fromspec_columns_info'; use namespace::clean; __PACKAGE__->cursor_class('DBIx::Class::Storage::DBI::ADO::MS_Jet::Cursor'); @@ -104,7 +107,7 @@ sub select_single { return @row unless $self->cursor_class->isa('DBIx::Class::Storage::DBI::ADO::MS_Jet::Cursor'); - my $col_infos = $self->_resolve_column_info($ident); + my $col_infos = fromspec_columns_info($ident); _normalize_guids($select, $col_infos, \@row, $self); diff --git a/lib/DBIx/Class/Storage/DBI/ADO/MS_Jet/Cursor.pm b/lib/DBIx/Class/Storage/DBI/ADO/MS_Jet/Cursor.pm index 8b1a782..89ab579 100644 --- a/lib/DBIx/Class/Storage/DBI/ADO/MS_Jet/Cursor.pm +++ b/lib/DBIx/Class/Storage/DBI/ADO/MS_Jet/Cursor.pm @@ -4,7 +4,9 @@ use strict; use warnings; use base 'DBIx::Class::Storage::DBI::Cursor'; use mro 'c3'; + use DBIx::Class::Storage::DBI::ADO::CursorUtils '_normalize_guids'; +use DBIx::Class::ResultSource::FromSpec::Util 'fromspec_columns_info'; use namespace::clean; =head1 NAME @@ -41,7 +43,7 @@ sub next { _normalize_guids( $self->args->[1], - $self->{_colinfos} ||= $self->storage->_resolve_column_info($self->args->[0]), + $self->{_colinfos} ||= fromspec_columns_info($self->args->[0]), \@row, $self->storage ); @@ -56,7 +58,7 @@ sub all { _normalize_guids( $self->args->[1], - $self->{_colinfos} ||= $self->storage->_resolve_column_info($self->args->[0]), + $self->{_colinfos} ||= fromspec_columns_info($self->args->[0]), $_, $self->storage ) for @rows; diff --git a/lib/DBIx/Class/Storage/DBI/ADO/Microsoft_SQL_Server.pm b/lib/DBIx/Class/Storage/DBI/ADO/Microsoft_SQL_Server.pm index ac42a1e..33a3e13 100644 --- a/lib/DBIx/Class/Storage/DBI/ADO/Microsoft_SQL_Server.pm +++ b/lib/DBIx/Class/Storage/DBI/ADO/Microsoft_SQL_Server.pm @@ -8,8 +8,10 @@ use base qw/ DBIx::Class::Storage::DBI::MSSQL /; use mro 'c3'; + use DBIx::Class::Carp; use DBIx::Class::Storage::DBI::ADO::CursorUtils qw/_normalize_guids _strip_trailing_binary_nulls/; +use DBIx::Class::ResultSource::FromSpec::Util 'fromspec_columns_info'; use namespace::clean; __PACKAGE__->cursor_class( @@ -140,7 +142,7 @@ sub select_single { 'DBIx::Class::Storage::DBI::ADO::Microsoft_SQL_Server::Cursor' ); - my $col_infos = $self->_resolve_column_info($ident); + my $col_infos = fromspec_columns_info($ident); _normalize_guids($select, $col_infos, \@row, $self); diff --git a/lib/DBIx/Class/Storage/DBI/ADO/Microsoft_SQL_Server/Cursor.pm b/lib/DBIx/Class/Storage/DBI/ADO/Microsoft_SQL_Server/Cursor.pm index 6253ee6..525526b 100644 --- a/lib/DBIx/Class/Storage/DBI/ADO/Microsoft_SQL_Server/Cursor.pm +++ b/lib/DBIx/Class/Storage/DBI/ADO/Microsoft_SQL_Server/Cursor.pm @@ -2,9 +2,12 @@ package DBIx::Class::Storage::DBI::ADO::Microsoft_SQL_Server::Cursor; use strict; use warnings; + use base 'DBIx::Class::Storage::DBI::Cursor'; use mro 'c3'; + use DBIx::Class::Storage::DBI::ADO::CursorUtils qw/_normalize_guids _strip_trailing_binary_nulls/; +use DBIx::Class::ResultSource::FromSpec::Util 'fromspec_columns_info'; use namespace::clean; =head1 NAME @@ -42,7 +45,7 @@ sub next { my @row = $self->next::method(@_); - $self->{_colinfos} ||= $self->storage->_resolve_column_info($self->args->[0]); + $self->{_colinfos} ||= fromspec_columns_info($self->args->[0]); _normalize_guids( $self->args->[1], @@ -66,7 +69,7 @@ sub all { my @rows = $self->next::method(@_); - $self->{_colinfos} ||= $self->storage->_resolve_column_info($self->args->[0]); + $self->{_colinfos} ||= fromspec_columns_info($self->args->[0]); for (@rows) { _normalize_guids( diff --git a/lib/DBIx/Class/Storage/DBI/SQLAnywhere.pm b/lib/DBIx/Class/Storage/DBI/SQLAnywhere.pm index e9bc102..9cb8306 100644 --- a/lib/DBIx/Class/Storage/DBI/SQLAnywhere.pm +++ b/lib/DBIx/Class/Storage/DBI/SQLAnywhere.pm @@ -4,6 +4,9 @@ use strict; use warnings; use base qw/DBIx::Class::Storage::DBI::UniqueIdentifier/; use mro 'c3'; +use DBIx::Class::_Util 'dbic_internal_try'; +use DBIx::Class::ResultSource::FromSpec::Util 'fromspec_columns_info'; +use namespace::clean; __PACKAGE__->mk_group_accessors(simple => qw/_identity/); __PACKAGE__->sql_limit_dialect ('RowNumberOver'); @@ -110,7 +113,7 @@ sub select_single { my ($ident, $select) = @_; - my $col_info = $self->_resolve_column_info($ident); + my $col_info = fromspec_columns_info($ident); for my $select_idx (0..$#$select) { my $selected = $select->[$select_idx]; diff --git a/lib/DBIx/Class/Storage/DBI/SQLAnywhere/Cursor.pm b/lib/DBIx/Class/Storage/DBI/SQLAnywhere/Cursor.pm index a341b20..8fb08a9 100644 --- a/lib/DBIx/Class/Storage/DBI/SQLAnywhere/Cursor.pm +++ b/lib/DBIx/Class/Storage/DBI/SQLAnywhere/Cursor.pm @@ -5,6 +5,9 @@ use warnings; use base 'DBIx::Class::Storage::DBI::Cursor'; use mro 'c3'; +use DBIx::Class::ResultSource::FromSpec::Util 'fromspec_columns_info'; +use namespace::clean; + =head1 NAME DBIx::Class::Storage::DBI::SQLAnywhere::Cursor - GUID Support for SQL Anywhere @@ -61,7 +64,7 @@ sub next { $unpack_guids->( $self->args->[1], - $self->{_colinfos} ||= $self->storage->_resolve_column_info($self->args->[0]), + $self->{_colinfos} ||= fromspec_columns_info($self->args->[0]), \@row, $self->storage ); @@ -76,7 +79,7 @@ sub all { $unpack_guids->( $self->args->[1], - $self->{_colinfos} ||= $self->storage->_resolve_column_info($self->args->[0]), + $self->{_colinfos} ||= fromspec_columns_info($self->args->[0]), $_, $self->storage ) for @rows; diff --git a/lib/DBIx/Class/Storage/DBIHacks.pm b/lib/DBIx/Class/Storage/DBIHacks.pm index e9cbdd6..b85fa78 100644 --- a/lib/DBIx/Class/Storage/DBIHacks.pm +++ b/lib/DBIx/Class/Storage/DBIHacks.pm @@ -33,6 +33,10 @@ use DBIx::Class::_Util qw( dump_value fail_on_internal_call ); use DBIx::Class::SQLMaker::Util 'extract_equality_conditions'; +use DBIx::Class::ResultSource::FromSpec::Util qw( + fromspec_columns_info + find_join_path_to_alias +); use DBIx::Class::Carp; use namespace::clean; @@ -167,7 +171,7 @@ sub _adjust_select_args_for_complex_prefetch { unless $root_node; # use the heavy duty resolver to take care of aliased/nonaliased naming - my $colinfo = $self->_resolve_column_info($inner_attrs->{from}); + my $colinfo = fromspec_columns_info($inner_attrs->{from}); my $selected_root_columns; for my $i (0 .. $#{$outer_attrs->{select}}) { @@ -444,7 +448,7 @@ sub _resolve_aliastypes_from_select_args { } # get a column to source/alias map (including unambiguous unqualified ones) - my $colinfo = $self->_resolve_column_info ($attrs->{from}); + my $colinfo = fromspec_columns_info($attrs->{from}); # set up a botched SQLA my $sql_maker = $self->sql_maker; @@ -633,7 +637,7 @@ sub _resolve_aliastypes_from_select_args { sub _group_over_selection { my ($self, $attrs) = @_; - my $colinfos = $self->_resolve_column_info ($attrs->{from}); + my $colinfos = fromspec_columns_info($attrs->{from}); my (@group_by, %group_index); @@ -769,130 +773,6 @@ sub _minmax_operator_for_datatype { $_[2] ? 'MAX' : 'MIN'; } -# Takes $ident, \@column_names -# -# returns { $column_name => \%column_info, ... } -# also note: this adds -result_source => $rsrc to the column info -# -# If no columns_names are supplied returns info about *all* columns -# for all sources -sub _resolve_column_info { - my ($self, $ident, $colnames) = @_; - - return {} if $colnames and ! @$colnames; - - my $sources = ( - # this is compat mode for insert/update/delete which do not deal with aliases - ( - blessed($ident) - and - $ident->isa('DBIx::Class::ResultSource') - ) ? +{ me => $ident } - - # not a known fromspec - no columns to resolve: return directly - : ref($ident) ne 'ARRAY' ? return +{} - - : +{ - # otherwise decompose into alias/rsrc pairs - map - { - ( $_->{-rsrc} and $_->{-alias} ) - ? ( @{$_}{qw( -alias -rsrc )} ) - : () - } - map - { - ( ref $_ eq 'ARRAY' and ref $_->[0] eq 'HASH' ) ? $_->[0] - : ( ref $_ eq 'HASH' ) ? $_ - : () - } - @$ident - } - ); - - $_ = { rsrc => $_, colinfos => $_->columns_info } - for values %$sources; - - my (%seen_cols, @auto_colnames); - - # compile a global list of column names, to be able to properly - # disambiguate unqualified column names (if at all possible) - for my $alias (keys %$sources) { - ( - ++$seen_cols{$_}{$alias} - and - ! $colnames - and - push @auto_colnames, "$alias.$_" - ) for keys %{ $sources->{$alias}{colinfos} }; - } - - $colnames ||= [ - @auto_colnames, - ( grep { keys %{$seen_cols{$_}} == 1 } keys %seen_cols ), - ]; - - my %return; - for (@$colnames) { - my ($colname, $source_alias) = reverse split /\./, $_; - - my $assumed_alias = - $source_alias - || - # if the column was seen exactly once - we know which rsrc it came from - ( - $seen_cols{$colname} - and - keys %{$seen_cols{$colname}} == 1 - and - ( %{$seen_cols{$colname}} )[0] - ) - || - next - ; - - $self->throw_exception( - "No such column '$colname' on source " . $sources->{$assumed_alias}{rsrc}->source_name - ) unless $seen_cols{$colname}{$assumed_alias}; - - $return{$_} = { - %{ $sources->{$assumed_alias}{colinfos}{$colname} }, - -result_source => $sources->{$assumed_alias}{rsrc}, - -source_alias => $assumed_alias, - -fq_colname => "$assumed_alias.$colname", - -colname => $colname, - }; - - $return{"$assumed_alias.$colname"} = $return{$_} - unless $source_alias; - } - - return \%return; -} - -sub _find_join_path_to_node { - my ($self, $from, $target_alias) = @_; - - # subqueries and other oddness are naturally not supported - return undef if ( - ref $from ne 'ARRAY' - || - ref $from->[0] ne 'HASH' - || - ! defined $from->[0]{-alias} - ); - - # no path - the head is the alias - return [] if $from->[0]{-alias} eq $target_alias; - - for my $i (1 .. $#$from) { - return $from->[$i][0]{-join_path} if ( ($from->[$i][0]{-alias}||'') eq $target_alias ); - } - - # something else went quite wrong - return undef; -} - sub _extract_order_criteria { my ($self, $order_by, $sql_maker) = @_; @@ -946,7 +826,7 @@ sub _order_by_is_stable { ( $where ? keys %{ extract_equality_conditions( $where ) } : () ), ) or return 0; - my $colinfo = $self->_resolve_column_info($ident, \@cols); + my $colinfo = fromspec_columns_info($ident, \@cols); return keys %$colinfo ? $self->_columns_comprise_identifying_set( $colinfo, \@cols ) @@ -976,7 +856,7 @@ sub _columns_comprise_identifying_set { sub _extract_colinfo_of_stable_main_source_order_by_portion { my ($self, $attrs) = @_; - my $nodes = $self->_find_join_path_to_node($attrs->{from}, $attrs->{alias}); + my $nodes = find_join_path_to_alias($attrs->{from}, $attrs->{alias}); return unless defined $nodes; @@ -991,7 +871,7 @@ sub _extract_colinfo_of_stable_main_source_order_by_portion { map { values %$_ } @$nodes, ) }; - my $colinfos = $self->_resolve_column_info($attrs->{from}); + my $colinfos = fromspec_columns_info($attrs->{from}); my ($colinfos_to_return, $seen_main_src_cols); @@ -1032,6 +912,20 @@ sub _extract_colinfo_of_stable_main_source_order_by_portion { ]) ? $colinfos_to_return : (); } +sub _resolve_column_info :DBIC_method_is_indirect_sugar { + DBIx::Class::_ENV_::ASSERT_NO_INTERNAL_INDIRECT_CALLS and fail_on_internal_call; + carp_unique("_resolve_column_info() is deprecated, ask on IRC for a better alternative"); + + fromspec_columns_info( @_[1,2] ); +} + +sub _find_join_path_to_node :DBIC_method_is_indirect_sugar { + DBIx::Class::_ENV_::ASSERT_NO_INTERNAL_INDIRECT_CALLS and fail_on_internal_call; + carp_unique("_find_join_path_to_node() is deprecated, ask on IRC for a better alternative"); + + find_join_path_to_alias( @_[1,2] ); +} + sub _collapse_cond :DBIC_method_is_indirect_sugar { DBIx::Class::_ENV_::ASSERT_NO_INTERNAL_INDIRECT_CALLS and fail_on_internal_call; carp_unique("_collapse_cond() is deprecated, ask on IRC for a better alternative"); diff --git a/xt/extra/internals/namespaces_cleaned.t b/xt/extra/internals/namespaces_cleaned.t index 89e2b54..eb25530 100644 --- a/xt/extra/internals/namespaces_cleaned.t +++ b/xt/extra/internals/namespaces_cleaned.t @@ -80,6 +80,7 @@ my $skip_idx = { map { $_ => 1 } ( # utility classes, not part of the inheritance chain 'DBIx::Class::Optional::Dependencies', 'DBIx::Class::ResultSource::RowParser::Util', + 'DBIx::Class::ResultSource::FromSpec::Util', 'DBIx::Class::SQLMaker::Util', 'DBIx::Class::_Util', ) };