database layer separation

Qiang on 2007-05-17T14:33:33

we are not writing big Perl software yet. most of them are small and few medium. We started with plain DBI and i am getting tired of writing prepare, execute, selectall_arrayref($sql,{Slice=>{}},@bind) quickly now.

I don't want to introduce ORM just yet as it is a pretty big change and i got lots other things to push to our Perl development. but I definitely see it as the way to go in the long run if our Perl development get bigger.

after some searching, I have found DBIx::Simple - a thin layer to DBI. I like the syntax and it is simple enough. tried asked other monks opinion on perlmonks and no answer so far.

I will spend more time to try it out. if it all goes well, DBIx::Simple will become one of our standard modules among TT and CGI::Application.


It’s great

Aristotle on 2007-05-18T01:01:09

But I saw that you found my review, so you know that already.

I’m using it now. I have no complaints at all, it’s excellent.

Re:It’s great

sigzero on 2007-05-18T11:46:41

Where is your review?

Re:It’s great

Aristotle on 2007-05-18T12:17:37

Here you go: A brief survey of the DBI usability layer modules on the CPAN

Try Rose

Ron Savage on 2007-05-21T01:56:03

Rose is another interface to databases. IMHO it's the best because it has the most Perl-like interface, so it fits effortlessly into the way Perl programmers think.

Re:Try Rose

Aristotle on 2007-05-21T06:03:59

If you want to go down that road, I’d suggest DBIx::Class instead.

DBIx::Dictionary

izut on 2008-01-14T07:09:33

I have the same problem you're having, so I wrote DBIx::Dictionary, which is not a replacement for DBIx::Simple, but helps you to have your SQL logic separated from your program. Used along with DBIx::Placeholder::Named, you can have a good abstraction layer for your applications :-)

Take a look if it looks promising, and drop a note if you have some problem ;-)