<?xml version="1.0" encoding="windows-1252"?>
<node id="557402" title="Class::DBI vs. DBIx::Class" created="2006-06-24 17:08:23" updated="2006-06-24 13:08:23">
<type id="115">
perlquestion</type>
<author id="557401">
hrr</author>
<data>
<field name="doctext">
Dear Monks:
&lt;br&gt;&lt;br&gt;
Class::DBI and DBIx::Class both seem to be very nice modules for accessing relational databases in an object-oriented way. Both modules look rather similar and it is hard for me to decide which one I should use.  It would be great, if you could advise me on this decision---generally I would prefer the more robust and stable solution.
&lt;br&gt;&lt;br&gt;
So far, I tried to use Class::DBI and DBD::DB2 on ActivePerl. This works for fine for SELECTs; however, insert() does not work for some reason (&lt;i&gt;Can't locate object method "insert"&lt;/i&gt;).  When I use DBD::CSV, insert works.  Alternatively, I could use perl on cygwin (but I have to find out how to compile DBD::DB2 there).  Hints on this problem would also be appreciated!
&lt;br&gt;&lt;br&gt;
Thank you,&lt;br&gt;
Best,&lt;br&gt;
Hansres
&lt;br&gt;&lt;br&gt;
&lt;b&gt;Update:&lt;/b&gt; Thanks for all these helpful comments! To summarize, the options are the following:
&lt;ul&gt;
&lt;li&gt; &lt;a href="http://search.cpan.org/perldoc?Class%3A%3ADBI"&gt;Class::DBI&lt;/a&gt;
provides a straightforward interface; however, its features are somewhat limited.
&lt;li&gt; &lt;a href="http://search.cpan.org/perldoc?DBIx%3A%3AClass"&gt;DBIx::Class&lt;/a&gt; provides more general interfaces that allow greater flexibility and complexity; this comes at the cost of being slightly more difficult to get started. Furthermore, this module has an active development community
&lt;li&gt; &lt;a href="http://search.cpan.org/search?mode=module&amp;query=Rose%3A%3ADB%3A%3AObject"&gt;Rose::DB::Object&lt;/a&gt;
provides a third alternative.   It supports only a limited number of databases (DBD modules are not sufficient; e.g., DB2 is not supported).
&lt;/ul&gt;</field>
</data>
</node>
