1 package # hide from PAUSE
2 DBIx::Class::ResultSourceProxy;
7 use base qw/DBIx::Class/;
8 use Scalar::Util qw/blessed/;
9 use Carp::Clan qw/^DBIx::Class/;
11 sub iterator_class { shift->result_source_instance->resultset_class(@_) }
12 sub resultset_class { shift->result_source_instance->resultset_class(@_) }
13 sub result_class { shift->result_source_instance->result_class(@_) }
14 sub source_info { shift->result_source_instance->source_info(@_) }
16 sub set_inherited_ro_instance {
19 croak "Cannot set @{[shift]} on an instance" if blessed $self;
21 return $self->set_inherited(@_);
24 sub get_inherited_ro_instance {
25 return shift->get_inherited(@_);
28 __PACKAGE__->mk_group_accessors('inherited_ro_instance' => 'source_name');
31 sub resultset_attributes {
32 shift->result_source_instance->resultset_attributes(@_);
36 my ($class, @cols) = @_;
37 my $source = $class->result_source_instance;
38 $source->add_columns(@cols);
39 foreach my $c (grep { !ref } @cols) {
40 # If this is an augment definition get the real colname.
43 $class->register_column($c => $source->column_info($c));
48 shift->add_columns(@_);
52 shift->result_source_instance->has_column(@_);
56 shift->result_source_instance->column_info(@_);
59 sub column_info_from_storage {
60 shift->result_source_instance->column_info_from_storage(@_);
64 shift->result_source_instance->columns(@_);
68 shift->result_source_instance->remove_columns(@_);
71 *remove_column = \&remove_columns;
74 shift->result_source_instance->set_primary_key(@_);
78 shift->result_source_instance->primary_columns(@_);
82 shift->result_source_instance->_pri_cols(@_);
85 sub add_unique_constraint {
86 shift->result_source_instance->add_unique_constraint(@_);
89 sub unique_constraints {
90 shift->result_source_instance->unique_constraints(@_);
93 sub unique_constraint_names {
94 shift->result_source_instance->unique_constraint_names(@_);
97 sub unique_constraint_columns {
98 shift->result_source_instance->unique_constraint_columns(@_);
101 sub add_relationship {
102 my ($class, $rel, @rest) = @_;
103 my $source = $class->result_source_instance;
104 $source->add_relationship($rel => @rest);
105 $class->register_relationship($rel => $source->relationship_info($rel));
109 shift->result_source_instance->relationships(@_);
112 sub relationship_info {
113 shift->result_source_instance->relationship_info(@_);
116 sub has_relationship {
117 shift->result_source_instance->has_relationship(@_);