Commit | Line | Data |
ea2e61bf |
1 | package DBIx::Class::CDBICompat; |
2 | |
3 | use strict; |
4 | use warnings; |
75a23b3e |
5 | use base qw/DBIx::Class::Core DBIx::Class::DB/; |
289ba852 |
6 | use Carp::Clan qw/^DBIx::Class/; |
7 | |
8 | eval { |
9 | require Class::Trigger; |
10 | require DBIx::ContextualFetch; |
11 | }; |
12 | croak "Class::Trigger and DBIx::ContextualFetch is required for CDBICompat" if $@; |
126042ee |
13 | |
55e2d745 |
14 | __PACKAGE__->load_own_components(qw/ |
15 | Constraints |
16 | Triggers |
17 | ReadOnly |
55e2d745 |
18 | LiveObjectIndex |
19 | AttributeAPI |
20 | Stringify |
21 | DestroyWarning |
22 | Constructor |
23 | AccessorMapping |
24 | ColumnCase |
a9c8094b |
25 | Relationships |
e60dc79f |
26 | Copy |
55e2d745 |
27 | LazyLoading |
28 | AutoUpdate |
29 | TempColumns |
e60dc79f |
30 | GetSet |
55e2d745 |
31 | Retrieve |
2a21de92 |
32 | Pager |
55e2d745 |
33 | ColumnGroups |
5ef62e9f |
34 | ColumnsAsHash |
e60dc79f |
35 | AbstractSearch |
36 | ImaDBI |
37 | Iterator |
38 | /); |
55e2d745 |
39 | |
40 | #DBIx::Class::ObjIndexStubs |
ea2e61bf |
41 | 1; |
34d52be2 |
42 | |
75d07914 |
43 | =head1 NAME |
34d52be2 |
44 | |
880a1a0c |
45 | DBIx::Class::CDBICompat - Class::DBI Compatibility layer. |
34d52be2 |
46 | |
15fe6346 |
47 | =head1 SYNOPSIS |
48 | |
49 | use base qw/DBIx::Class/; |
50 | __PACKAGE__->load_components(qw/CDBICompat Core DB/); |
51 | |
34d52be2 |
52 | =head1 DESCRIPTION |
53 | |
880a1a0c |
54 | DBIx::Class features a fully featured compatibility layer with L<Class::DBI> |
e7d1440f |
55 | and L<Class::DBI::AbstractSearch> to ease transition for existing CDBI users. |
56 | |
57 | In fact, this class is just a receipe containing all the features emulated. |
58 | If you like, you can choose which features to emulate by building your |
59 | own class and loading it like this: |
15fe6346 |
60 | |
61 | __PACKAGE__->load_own_components(qw/CDBICompat/); |
62 | |
75d07914 |
63 | this will automatically load the features included in My::DB::CDBICompat, |
15fe6346 |
64 | provided it looks something like this: |
65 | |
66 | package My::DB::CDBICompat; |
67 | __PACKAGE__->load_components(qw/ |
68 | CDBICompat::ColumnGroups |
69 | CDBICompat::Retrieve |
70 | CDBICompat::HasA |
71 | CDBICompat::HasMany |
72 | CDBICompat::MightHave |
73 | /); |
74 | |
15fe6346 |
75 | =back |
34d52be2 |
76 | |
e7d1440f |
77 | =head1 LIMITATIONS |
78 | |
79 | The following methods and classes are not emulated, maybe in the future. |
80 | |
81 | =over 4 |
82 | |
83 | =item Class::DBI::Query |
84 | |
85 | Deprecated in Class::DBI. |
86 | |
87 | =item Class::DBI::Column |
88 | |
89 | Not documented in Class::DBI. CDBICompat's columns() returns a plain string, not an object. |
90 | |
91 | =item data_type() |
92 | |
93 | Undocumented CDBI method. |
94 | |
474481a9 |
95 | =item Class::DBI::Relationship |
e7d1440f |
96 | |
474481a9 |
97 | The semi-documented Class::DBI::Relationship objects returned by C<meta_info($type, $col)> are mostly emulated except for their C<args> method. |
e7d1440f |
98 | |
99 | =back |
100 | |
34d52be2 |
101 | =head1 AUTHORS |
102 | |
daec44b8 |
103 | Matt S. Trout <mst@shadowcatsystems.co.uk> |
34d52be2 |
104 | |
105 | =head1 LICENSE |
106 | |
107 | You may distribute this code under the same terms as Perl itself. |
108 | |
109 | =cut |
110 | |