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.
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 (Can't locate object method "insert"
). 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!
Thanks for all these helpful comments! To summarize, the options are the following:
provides a straightforward interface; however, its features are somewhat limited.
- DBIx::Class 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
provides a third alternative. It supports only a limited number of databases (DBD modules are not sufficient; e.g., DB2 is not supported).
Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
Read Where should I post X? if you're not absolutely sure you're posting in the right place.
Please read these before you post! —
Posts may use any of the Perl Monks Approved HTML tags:
You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
- a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
Link using PerlMonks shortcuts! What shortcuts can I use for linking?
See Writeup Formatting Tips and other pages linked from there for more info.
| & || & |
| < || < |
| > || > |
| [ || [ |
| ] || ] ||