What's the fastest way to get CRUD over CGI on a database handle in Perl?

我怕爱的太早我们不能终老 提交于 2019-12-06 03:10:41

问题


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.


回答1:


Perhaps CGI-Browse suits your taste.



来源:https://stackoverflow.com/questions/2796232/whats-the-fastest-way-to-get-crud-over-cgi-on-a-database-handle-in-perl

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!