CPAN Module Review: Jifty::DBI

by chromatic

Jifty::DBI is yet another database abstraction layer, with object-relational mapping and (more importantly to me) schema generation. It's part of Jifty, the new web development toolkit from Best Practical (creators of RT) and it's a re-imagining of DBIx::SearchBuilder.

Despite its history, the public distribution is fairly new and has some rough patches, mostly related to documentation and understanding. I experimented with the latest stable release (0.16) for a couple of afternoons. Here's what I learned.


2006-03-17 15:53:33
Take a look at DBIx::Class - which has schema generation via SQL-T, and has a decent amount of documentation. Multi-way joins are trivial, as are many-to-many and prefetching.
2006-03-21 06:58:24
I just skimmed this article, but some of the earlier code reminded me a lot of my first attempts to play with Class::DBI, before I learned that I could have it figure out for itself what the database looks like. I really hate repeating my database design; is there any way within Jifty to do this automatically?

There are a lot of database wrappers out there, from Class::DBI to DBIx::Simple, etc. I'd certainly appreciate a comparision of features and API, as I tend to stick with what I know.

2006-03-22 11:51:49

A, I didn't see a way to make Jifty::DBI scan an existing database. The documentation lead me to believe that the preferred approach is to declare your schema in Perl with Jifty::DBI::Schema and generate your database from there.

2006-03-29 05:29:18
Chromatic is correct. The "Jifty Way" is to use Jifty to manage your database schema. Jifty::DBI is very much "the first part" of Jifty ( that was made publicly available. When using Jifty, at least a couple of the warts mentioned go away ;) We thought long and hard about whether to even release the module on its own, but enough people asked that we decided to do it. But for something that feels coherent, I'd strongly recommend using Jifty::DBI in the context of Jifty itself
2006-03-30 03:07:53
Jifty::DBI uses DBIx::DBSchema already, and DBIx::DBSchema does know how to scan and reverse-engineer the schema of an existing database... (new_native and new_odbc)
2007-11-22 21:31:30