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
-
Are you posting in the right place? Check out Where do I post X? to know for sure.
-
Posts may use any of the Perl Monks Approved HTML tags. Currently these include the following:
<code> <a> <b> <big>
<blockquote> <br /> <dd>
<dl> <dt> <em> <font>
<h1> <h2> <h3> <h4>
<h5> <h6> <hr /> <i>
<li> <nbsp> <ol> <p>
<small> <strike> <strong>
<sub> <sup> <table>
<td> <th> <tr> <tt>
<u> <ul>
-
Snippets of code should be wrapped in
<code> tags not
<pre> tags. In fact, <pre>
tags should generally be avoided. If they must
be used, extreme care should be
taken to ensure that their contents do not
have long lines (<70 chars), in order to prevent
horizontal scrolling (and possible janitor
intervention).
-
Want more info? How to link
or How to display code and escape characters
are good places to start.
|