assemble_simple_parser
assemble_collapsing_parser
);
+use DBIx::Class::_Util qw( DUMMY_ALIASPAIR dbic_internal_try dbic_internal_catch );
use DBIx::Class::Carp;
+# FIXME - this should go away
+# instead Carp::Skip should export usable keywords or something like that
+my $unique_carper;
+BEGIN { $unique_carper = \&carp_unique }
+
use namespace::clean;
# Accepts a prefetch map (one or more relationships for the current source),
is_single => ( $inf->{attrs}{accessor} && $inf->{attrs}{accessor} ne 'multi' ),
is_inner => ( ( $inf->{attrs}{join_type} || '' ) !~ /^left/i),
rsrc => $self->related_source($rel),
- fk_map => $self->_resolve_relationship_condition(
- rel_name => $rel,
- self_alias => "\xFE", # irrelevant
- foreign_alias => "\xFF", # irrelevant
- )->{identity_map},
+ fk_map => (
+ dbic_internal_try {
+ $self->resolve_relationship_condition(
+ rel_name => $rel,
+
+ # an API where these are optional would be too cumbersome,
+ # instead always pass in some dummy values
+ DUMMY_ALIASPAIR,
+ )->{identity_map},
+ }
+ dbic_internal_catch {
+
+ $unique_carper->(
+ "Resolution of relationship '$rel' failed unexpectedly, "
+ . 'please relay the following error and seek assistance via '
+ . DBIx::Class::_ENV_::HELP_URL . ". Encountered error: $_"
+ );
+
+ # RV
+ +{}
+ }
+ ),
};
}
is_single => $relinfo->{$rel}{is_single},
- # if there is at least one *inner* reverse relationship which is HASH-based (equality only)
+ # if there is at least one *inner* reverse relationship ( meaning identity-only )
# we can safely assume that the child can not exist without us
- rev_rel_is_optional => ( grep
- { ref $_->{cond} eq 'HASH' and ($_->{attrs}{join_type}||'') !~ /^left/i }
- values %{ $self->reverse_relationship_info($rel) },
- ) ? 0 : 1,
+ rev_rel_is_optional => (
+ ( grep {
+ ($_->{attrs}{join_type}||'') !~ /^left/i
+ } values %{ $self->reverse_relationship_info($rel) } )
+ ? 0
+ : 1
+ ),
# if this is a 1:1 our own collapser can be used as a collapse-map
# (regardless of left or not)