What's the fastest way to get CRUD over CGI on a database handle in Perl?
Posted
by mithaldu
on Stack Overflow
See other posts from Stack Overflow
or by mithaldu
Published on 2010-05-09T00:58:15Z
Indexed on
2010/05/09
1:08 UTC
Read the original article
Hit count: 423
TL;DR: Want to write CGI::CRUD::Simple (a minimalist interface module for CGI::CRUD), but I want to check first if i overlooked a module that already does that.
I usually work with applications that don't have the niceties of having frameworks and such already in place. However, a while ago i found myself in a situation where i was asking myself: "Self, i have a DBI database handle and a CGI query object, isn't there a module somewhere that can use this to give me some CRUD so i can move on and work on other things instead of spending hours writing an interface?"
A quick survey on CPAN gave me:
CGI::Crud
Catalyst::Plugin::CRUD
Gantry::Plugins::CRUD
Jifty::View::Declare::CRUD
CatalystX::CRUD
Catalyst::Controller::CRUD
CatalystX::CRUD::REST
Catalyst::Enzyme
Now, I didn't go particularly in-depth when looking at these modules, but, safe the first one, they all seem to require the presence of some sort of framework. Please tell me if i was wrong and i can just plug any of those into a barebones CGI script.
CGI::CRUD seemed to do exactly what i wanted, although it did insist on being used through a rather old and C-like script that must be acquired on a different site and then prodded in various ways and manners to produce something useful. I went with that and found that it works pretty neat and that it should be rather easy to write a simple and easy-to-use module that provides a very basic [dbh, cgi IN]->[html OUT] interface to it.
However, as my previous survey was rather short and i may have been hasty in dismissing modules or missed others, i find myself wondering whether that would only be duplication of work already done.
As such i ponder the question in the title.
PS: I tend to be too short in some of my explanations and make too many assumptions that others think about things similarly as me, resulting in leaving out critical details. If you find yourself wondering just what exactly I am thinking about when i say CRUD, please poke me in comments and I'll amend the question.
© Stack Overflow or respective owner