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 | |
55e2d745 | 25 | HasA |
75a23b3e | 26 | HasMany |
503536d5 | 27 | MightHave |
e60dc79f | 28 | Copy |
55e2d745 | 29 | LazyLoading |
30 | AutoUpdate | |
31 | TempColumns | |
e60dc79f | 32 | GetSet |
55e2d745 | 33 | Retrieve |
2a21de92 | 34 | Pager |
55e2d745 | 35 | ColumnGroups |
e60dc79f | 36 | AbstractSearch |
37 | ImaDBI | |
38 | Iterator | |
39 | /); | |
55e2d745 | 40 | |
41 | #DBIx::Class::ObjIndexStubs | |
ea2e61bf | 42 | 1; |
34d52be2 | 43 | |
75d07914 | 44 | =head1 NAME |
34d52be2 | 45 | |
880a1a0c | 46 | DBIx::Class::CDBICompat - Class::DBI Compatibility layer. |
34d52be2 | 47 | |
15fe6346 | 48 | =head1 SYNOPSIS |
49 | ||
50 | use base qw/DBIx::Class/; | |
51 | __PACKAGE__->load_components(qw/CDBICompat Core DB/); | |
52 | ||
34d52be2 | 53 | =head1 DESCRIPTION |
54 | ||
880a1a0c | 55 | DBIx::Class features a fully featured compatibility layer with L<Class::DBI> |
e7d1440f | 56 | and L<Class::DBI::AbstractSearch> to ease transition for existing CDBI users. |
57 | ||
58 | In fact, this class is just a receipe containing all the features emulated. | |
59 | If you like, you can choose which features to emulate by building your | |
60 | own class and loading it like this: | |
15fe6346 | 61 | |
62 | __PACKAGE__->load_own_components(qw/CDBICompat/); | |
63 | ||
75d07914 | 64 | this will automatically load the features included in My::DB::CDBICompat, |
15fe6346 | 65 | provided it looks something like this: |
66 | ||
67 | package My::DB::CDBICompat; | |
68 | __PACKAGE__->load_components(qw/ | |
69 | CDBICompat::ColumnGroups | |
70 | CDBICompat::Retrieve | |
71 | CDBICompat::HasA | |
72 | CDBICompat::HasMany | |
73 | CDBICompat::MightHave | |
74 | /); | |
75 | ||
2053ab2a | 76 | =head1 COMPONENTS |
15fe6346 | 77 | |
78 | =over 4 | |
79 | ||
80 | =item AccessorMapping | |
81 | ||
e60dc79f | 82 | =item AbstractSearch |
83 | ||
84 | Compatibility with Class::DBI::AbstractSearch. | |
85 | ||
15fe6346 | 86 | =item AttributeAPI |
87 | ||
88 | =item AutoUpdate | |
89 | ||
90 | Allows you to turn on automatic updates for column values. | |
91 | ||
92 | =item ColumnCase | |
93 | ||
94 | =item ColumnGroups | |
95 | ||
96 | =item Constraints | |
97 | ||
98 | =item Constructor | |
99 | ||
100 | =item DestroyWarning | |
101 | ||
102 | =item GetSet | |
103 | ||
104 | =item HasA | |
105 | ||
15fe6346 | 106 | =item HasMany |
107 | ||
15fe6346 | 108 | =item ImaDBI |
109 | ||
110 | =item LazyLoading | |
111 | ||
112 | =item LiveObjectIndex | |
113 | ||
114 | The live object index tries to ensure there is only one version of a object | |
880a1a0c | 115 | in the perl interpreter. |
15fe6346 | 116 | |
117 | =item MightHave | |
118 | ||
15fe6346 | 119 | =item ObjIndexStubs |
120 | ||
121 | =item ReadOnly | |
122 | ||
123 | =item Retrieve | |
124 | ||
125 | =item Stringify | |
126 | ||
127 | =item TempColumns | |
128 | ||
129 | =item Triggers | |
130 | ||
15fe6346 | 131 | =item PassThrough |
132 | ||
133 | =back | |
34d52be2 | 134 | |
e7d1440f | 135 | =head1 LIMITATIONS |
136 | ||
137 | The following methods and classes are not emulated, maybe in the future. | |
138 | ||
139 | =over 4 | |
140 | ||
141 | =item Class::DBI::Query | |
142 | ||
143 | Deprecated in Class::DBI. | |
144 | ||
145 | =item Class::DBI::Column | |
146 | ||
147 | Not documented in Class::DBI. CDBICompat's columns() returns a plain string, not an object. | |
148 | ||
149 | =item data_type() | |
150 | ||
151 | Undocumented CDBI method. | |
152 | ||
153 | =item meta_info() | |
154 | ||
155 | Undocumented CDBI method. | |
156 | ||
157 | =back | |
158 | ||
34d52be2 | 159 | =head1 AUTHORS |
160 | ||
daec44b8 | 161 | Matt S. Trout <mst@shadowcatsystems.co.uk> |
34d52be2 | 162 | |
163 | =head1 LICENSE | |
164 | ||
165 | You may distribute this code under the same terms as Perl itself. | |
166 | ||
167 | =cut | |
168 |