Async/Exception/AmbiguousColumn.pm

filter: Statementstmt 100% 20 / 20 Branchbran n/a Conditioncond n/a MC/DCmcdc n/a Subroutinesub 100% 6 / 6 Podpod 50.0% 1 / 2 totaltotal 96.4% 27 / 28 CC 1 SCAR 0.0
CC
1
Cov
100%
BEGIN
1.0
BEGIN
1.0
BEGIN
1.0
CRAP 1.0
« Async/ResultSetColumn.pm ↑ Summary Async/Exception/MissingColumn.pm »
1 package DBIx::Class::Async::Exception::AmbiguousColumn;
2  
3 102 ▶use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
4 102 ▶use warnings;
Subroutine BEGIN: called CC=1 SCAR=0.0
5 102 ▶use version;
Subroutine BEGIN: called CC=1 SCAR=0.0
6  
7 102 our $VERSION = qv('v1.2.0');
8 102 our $AUTHORITY = 'cpan:MANWAR';
9  
10 102 ▶use parent 'DBIx::Class::Async::Exception';
Subroutine BEGIN: called CC=1 SCAR=0.0
11  
12 =head1 NAME
13  
14 DBIx::Class::Async::Exception::AmbiguousColumn - Exception for column names
15 that are ambiguous across joined tables
16  
17 =head1 VERSION
18  
19 Version v1.2.0
20  
21 =head1 SYNOPSIS
22  
23 use DBIx::Class::Async::Exception::AmbiguousColumn;
24  
25 DBIx::Class::Async::Exception::AmbiguousColumn->throw(
26 message => "[DBIx::Class::Async] Ambiguous column 'status' - exists in multiple joined tables",
27 column => 'status',
28 hint => "Qualify the column: use 'me.status' for the primary table "
29 . "or 'relname.status' for a join.",
30 );
31  
32 use Try::Tiny;
33 try { ... } catch {
34 if ( ref $_ && $_->isa('DBIx::Class::Async::Exception::AmbiguousColumn') ) {
35 warn "Ambiguous column '" . $_->column . "': " . $_->hint;
36 }
37 };
38  
39 =head1 DESCRIPTION
40  
41 Thrown when a column name appears in multiple tables that are joined in a
42 query, and has not been qualified with a table alias such as C<me.column> or
43 C<relname.column>.
44  
45 Inherits all methods from L<DBIx::Class::Async::Exception> and adds
46 L</column>.
47  
48 =cut
49  
50 2 ▶sub new {
Subroutine new: called CC=1 SCAR=0.0
Pod undocumented
51 2 my ($class, %args) = @_;
52 2 my $self = $class->SUPER::new(%args);
53 2 $self->{column} = $args{column};
54 2 return $self;
55 }
56  
57 =head1 METHODS
58  
59 Inherits C<throw>, C<rethrow>, C<message>, C<hint>, C<original_error>,
60 C<operation>, C<source_class>, and C<stacktrace> from
61 L<DBIx::Class::Async::Exception>.
62  
63 =head2 column
64  
65 my $col = $exception->column;
66  
67 The name of the column that is ambiguous across joined tables, e.g. C<'status'>.
68  
69 =cut
70  
71 2 ▶sub column { $_[0]->{column} }
Subroutine column: called CC=1 SCAR=0.0
Pod documented
72  
73 =head1 SEE ALSO
74  
75 L<DBIx::Class::Async::Exception>, L<DBIx::Class::Async::Exception::Factory>
76  
77 =head1 AUTHOR
78  
79 Mohammad Sajid Anwar, C<< <mohammad.anwar at yahoo.com> >>
80  
81 =head1 REPOSITORY
82  
83 L<https://github.com/manwar/DBIx-Class-Async>
84  
85 =head1 BUGS
86  
87 Please report any bugs or feature requests through the web interface at L<https://github.com/manwar/DBIx-Class-Async/issues>.
88 I will be notified and then you'll automatically be notified of progress on your
89 bug as I make changes.
90  
91 =head1 SUPPORT
92  
93 You can find documentation for this module with the perldoc command.
94  
95 perldoc DBIx::Class::Async::Exception::AmbiguousColumn
96  
97 You can also look for information at:
98  
99 =over 4
100  
101 =item * BUG Report
102  
103 L<https://github.com/manwar/DBIx-Class-Async/issues>
104  
105 =item * CPAN Ratings
106  
107 L<http://cpanratings.perl.org/d/DBIx-Class-Async>
108  
109 =item * Search MetaCPAN
110  
111 L<https://metacpan.org/dist/DBIx-Class-Async/>
112  
113 =back
114  
115 =head1 LICENSE AND COPYRIGHT
116  
117 Copyright (C) 2026 Mohammad Sajid Anwar.
118  
119 This program is free software; you can redistribute it and / or modify it under
120 the terms of the the Artistic License (2.0). You may obtain a copy of the full
121 license at:
122 L<http://www.perlfoundation.org/artistic_license_2_0>
123 Any use, modification, and distribution of the Standard or Modified Versions is
124 governed by this Artistic License.By using, modifying or distributing the Package,
125 you accept this license. Do not use, modify, or distribute the Package, if you do
126 not accept this license.
127 If your Modified Version has been derived from a Modified Version made by someone
128 other than you,you are nevertheless required to ensure that your Modified Version
129 complies with the requirements of this license.
130 This license does not grant you the right to use any trademark, service mark,
131 tradename, or logo of the Copyright Holder.
132 This license includes the non-exclusive, worldwide, free-of-charge patent license
133 to make, have made, use, offer to sell, sell, import and otherwise transfer the
134 Package with respect to any patent claims licensable by the Copyright Holder that
135 are necessarily infringed by the Package. If you institute patent litigation
136 (including a cross-claim or counterclaim) against any party alleging that the
137 Package constitutes direct or contributory patent infringement,then this Artistic
138 License to you shall terminate on the date that such litigation is filed.
139 Disclaimer of Warranty: THE PACKAGE IS PROVIDED BY THE COPYRIGHT HOLDER AND
140 CONTRIBUTORS "AS IS' AND WITHOUT ANY EXPRESS OR IMPLIED WARRANTIES. THE IMPLIED
141 WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, OR
142 NON-INFRINGEMENT ARE DISCLAIMED TO THE EXTENT PERMITTED BY YOUR LOCAL LAW. UNLESS
143 REQUIRED BY LAW, NO COPYRIGHT HOLDER OR CONTRIBUTOR WILL BE LIABLE FOR ANY DIRECT,
144 INDIRECT, INCIDENTAL, OR CONSEQUENTIAL DAMAGES ARISING IN ANY WAY OUT OF THE USE
145 OF THE PACKAGE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
146  
147 =cut
148  
149 102 1; # End of DBIx::Class::Async::Exception::AmbiguousColumn
« Async/ResultSetColumn.pm ↑ Summary Async/Exception/MissingColumn.pm »