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