Commit | Line | Data |
75d07914 |
1 | package # hide from PAUSE |
c0e7b4e5 |
2 | DBIx::Class::ResultSourceProxy; |
b98e75f6 |
3 | |
4 | use strict; |
5 | use warnings; |
6 | |
7 | use base qw/DBIx::Class/; |
8 | |
5ac6a044 |
9 | sub iterator_class { shift->result_source_instance->resultset_class(@_) } |
b98e75f6 |
10 | sub resultset_class { shift->result_source_instance->resultset_class(@_) } |
bab77431 |
11 | sub source_name { shift->result_source_instance->source_name(@_) } |
b98e75f6 |
12 | |
5ac6a044 |
13 | sub resultset_attributes { |
14 | shift->result_source_instance->resultset_attributes(@_); |
15 | } |
16 | |
b98e75f6 |
17 | sub add_columns { |
18 | my ($class, @cols) = @_; |
1f23a877 |
19 | my $source = $class->result_source_instance; |
20 | $source->add_columns(@cols); |
21 | foreach my $c (grep { !ref } @cols) { |
22 | $class->register_column($c => $source->column_info($c)); |
23 | } |
b98e75f6 |
24 | } |
25 | |
002a359a |
26 | *add_column = \&add_columns; |
27 | |
75d07914 |
28 | sub has_column { |
29 | my ($self, $column) = @_; |
30 | return $self->result_source_instance->has_column($column); |
b98e75f6 |
31 | } |
32 | |
75d07914 |
33 | sub column_info { |
34 | my ($self, $column) = @_; |
35 | return $self->result_source_instance->column_info($column); |
b98e75f6 |
36 | } |
37 | |
002a359a |
38 | |
75d07914 |
39 | sub columns { |
40 | return shift->result_source_instance->columns(@_); |
41 | } |
002a359a |
42 | |
43 | sub remove_columns { |
44 | return shift->result_source_instance->remove_columns(@_); |
45 | } |
46 | |
47 | *remove_column = \&remove_columns; |
48 | |
bc0c9800 |
49 | sub set_primary_key { |
50 | shift->result_source_instance->set_primary_key(@_); |
51 | } |
52 | |
53 | sub primary_columns { |
54 | shift->result_source_instance->primary_columns(@_); |
55 | } |
b98e75f6 |
56 | |
bc0c9800 |
57 | sub add_unique_constraint { |
58 | shift->result_source_instance->add_unique_constraint(@_); |
59 | } |
60 | |
61 | sub unique_constraints { |
62 | shift->result_source_instance->unique_constraints(@_); |
63 | } |
87f0da6a |
64 | |
1bc0b925 |
65 | sub unique_constraint_names { |
66 | shift->result_source_instance->unique_constraint_names(@_); |
67 | } |
68 | |
69 | sub unique_constraint_columns { |
70 | shift->result_source_instance->unique_constraint_columns(@_); |
71 | } |
72 | |
8c49f629 |
73 | sub add_relationship { |
71e65b39 |
74 | my ($class, $rel, @rest) = @_; |
75 | my $source = $class->result_source_instance; |
76 | $source->add_relationship($rel => @rest); |
77 | $class->register_relationship($rel => $source->relationship_info($rel)); |
8c49f629 |
78 | } |
79 | |
80 | sub relationships { |
81 | shift->result_source_instance->relationships(@_); |
82 | } |
83 | |
84 | sub relationship_info { |
85 | shift->result_source_instance->relationship_info(@_); |
86 | } |
87 | |
b98e75f6 |
88 | 1; |