Taking a quick read through the
Tie::DBI pod, it looks like it doesn't support any of the relationships that
Class::DBI does such has
has_a and
has_many. Also, it seems like CDBI's
search() method is better than TDBI's
select_where() method, and also CDBI has support for custom queries via
set_sql but w/TDBI you just jet the
dbh() to do it all yourself. TDBI docs also warn of performance concerns (but as for a direct TDBI-CDBI benchmark, i can't say). Another significant difference is that TDBI ties you to a hash, while CDBI provides objects to work with and all the obvious benefits that come with it (can't mispell hash keys, accessors/mutators, inheritance, custom methods, etc). Also note that CDBI has further support for specific databases in the Class::DBI::* modules (Class::DBI::Pg, Class::DBI::MSSQL, Class::DBI::mysql, etc), as well as Plugins. Class::DBI will also be far more supported by the mailing list and the wiki.
To summarize, I would say that TDBI is a lot more limited, and only consider it if your needs are very limited (just a couple/few unrelated tables), and even then I personally would still use CDBI.
Update: Summary bulletin points of things CDBI has that TDBI doesn't:
- relationships (has_a and has_many)
- search() better than select_where()
- custom queries (set_sql)
- better performance??
- provides an object, not just a hash
- db-specific support in the Class::DBI::* modules
- Plugins
- Support via active mailing list and wiki
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:
- a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, 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, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
| |
For: |
|
Use: |
| & | | & |
| < | | < |
| > | | > |
| [ | | [ |
| ] | | ] |
Link using PerlMonks shortcuts! What shortcuts can I use for linking?
See Writeup Formatting Tips and other pages linked from there for more info.