Merge 'trunk' into 'cdbicompat_integration'
[dbsrgits/DBIx-Class.git] / lib / DBIx / Class / CDBICompat.pm
CommitLineData
ea2e61bf 1package DBIx::Class::CDBICompat;
2
3use strict;
4use warnings;
75a23b3e 5use base qw/DBIx::Class::Core DBIx::Class::DB/;
289ba852 6use Carp::Clan qw/^DBIx::Class/;
7
8eval {
9 require Class::Trigger;
10 require DBIx::ContextualFetch;
11};
12croak "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 421;
34d52be2 43
75d07914 44=head1 NAME
34d52be2 45
880a1a0c 46DBIx::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 55DBIx::Class features a fully featured compatibility layer with L<Class::DBI>
e7d1440f 56and L<Class::DBI::AbstractSearch> to ease transition for existing CDBI users.
57
58In fact, this class is just a receipe containing all the features emulated.
59If you like, you can choose which features to emulate by building your
60own class and loading it like this:
15fe6346 61
62 __PACKAGE__->load_own_components(qw/CDBICompat/);
63
75d07914 64this will automatically load the features included in My::DB::CDBICompat,
15fe6346 65provided 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
84Compatibility with Class::DBI::AbstractSearch.
85
15fe6346 86=item AttributeAPI
87
88=item AutoUpdate
89
90Allows 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
114The live object index tries to ensure there is only one version of a object
880a1a0c 115in 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
137The following methods and classes are not emulated, maybe in the future.
138
139=over 4
140
141=item Class::DBI::Query
142
143Deprecated in Class::DBI.
144
145=item Class::DBI::Column
146
147Not documented in Class::DBI. CDBICompat's columns() returns a plain string, not an object.
148
149=item data_type()
150
151Undocumented CDBI method.
152
153=item meta_info()
154
155Undocumented CDBI method.
156
157=back
158
34d52be2 159=head1 AUTHORS
160
daec44b8 161Matt S. Trout <mst@shadowcatsystems.co.uk>
34d52be2 162
163=head1 LICENSE
164
165You may distribute this code under the same terms as Perl itself.
166
167=cut
168