Beefy Boxes and Bandwidth Generously Provided by pair Networks
Pathologically Eclectic Rubbish Lister

DBIx-compatible module to use for CGI CRUD/BREAD?

by jfrm (Monk)
on Sep 10, 2006 at 07:33 UTC ( #572200=perlquestion: print w/replies, xml ) Need Help??

jfrm has asked for the wisdom of the Perl Monks concerning the following question:

I'm writing prototype code to establish proof of concept for a web database app. I have DBIx-Class working and searching OK.

I'd like to use webforms (just basic CGI HTML), first to just to search and show results from searches but also to do CRUD/BREAD. I can see a number of modules that might help. I'd rather not guess which are the best modules/methods to use...

I've located 12 likely modules and skimmed through the documentation of each + other stuff and reduced my list to 3 options. The others I've categorised according to my reason for rejection underneath. I would be grateful if anyone can:

  1. comment on the validity; compare/contrast these 3 otherwise help to decide which is most appropriate
  2. comment on the wisdom of the elimination of the other candidates
  3. Suggest another candidate that I missed?

Otherwise, perhaps the list will be useful to other beginners anyway.

Based on DBIx, sounds straightforward
DBIx::HTMLinterface Class for creating a CGI interface to a database DBIx-HTMLinterface-0.11 - 15 Dec 1999 - James Furness [The DBIx::HTMLinterface class allows a CGI interface to a database. I +t enables a CGI interface to a database to be created, supporting rec +ord addition, modification, deletion and searching. It provides a use +r friendly interface with descriptions of fields provided. The field +descriptions along with information on whether the field is visible, +hidden or excluded are extracted from a table, allowing easy modifica +tion and addition of fields and tables without having to edit code. Features Simple database administration. Forms are created automatically on dem +and, SQL statements are generated as needed and processed. The module + contains enough autonomy to potentially run with only wrapper perl c +ode placed around it. Full form configuration Forms can be modified to add descriptions and extra information to fie +lds, making it easy to change output without having to edit code. Control Extensive callback procedures and configuration options allow output, +password protection and logging to be configured as desired. Full HTML customisation HTML output and table formats can be customised easily by the user.]
DBIx::HTMLView For creating web userinterfaces to DBI databases. DBIx-HTMLView-0.1 - 01 Oct 2001 - Hakan Ardo [This is a general propose module to simplify the creation of web user +interfaces to a DBI database, currently it can list, view, add, edit +and delete entries in the databse using either <input ...> or <textar +ea> to gather the info. Se the new method description for info on how + to define the database format and how the fields should be edited.]
CGI::FormBuilder Easily generate and process stateful forms CGI-FormBuilder-3.0401 - 08 Sep 2006 - Nate Wiger [Nate: As for feeding DBIC directly into FB w/o Catalyst, all you real +ly need is to use get_columns and pass this list into FB->new. A simp +le form will be created automatically.]
Based on Catalyst or otherwise similarly frightening
Catalyst::Plugin::FormBuilder Catalyst FormBuilder Plugin Catalyst-Plugin-FormBuilder-1.05 - 07 Sep 2006 - Nate Wiger
Catalyst::Plugin::CRUD::DBIC CRUD (create/read/update/delete) Plugin for DBIx::Class Catalyst-Plugin-CRUD-0.13 - 28 Aug 2006 - Jun Shimizu
DBIx::Class::HTMLWidget Like FromForm but with DBIx::Class and HTML::Widget DBIx-Class-HTMLWidget-0.06 - 15 Jun 2006 - Marcus Ramberg [ You'll need a working DBIx::Class setup and some knowledge of HTML:: +Widget and Catalyst. ]
DBIx::Class::InstantCRUD Like DBIx::Class::HTMLWidget but handles relationships and extra info +in the columns_info metadata. It also has methods to put DBIC objects + into HTML Catalyst-Example-InstantCRUD-v0.0.14 - 23 Aug 2006 - Zbigniew Lukasiak [You'll need a working DBIx::Class setup and some knowledge of HTML::W +idget and Catalyst. ]
DBIx::Class::FormTools Utility module for building forms with multiple related DBIx::Class ob +jects. DBIx-Class-FormTools-0.000004 - 21 Jun 2006 - David Jack Olrik [The module is not ment to be used directly, although it can of-course + be done as seen in the above example, but rather used as a utility m +odule in a Catalyst helper module or other equivalent framework.]
Based on CDBI - therefore presumably will not have functionalily of modules based on DBIC
CGI::Application::Plugin::BREAD Plugin for Dynamic Database Management Application CGI-Application-Plugin-BREAD-0.12_2 - 10 Jul 2005 - Jason Purdy [A lot of emphasis has been put on Ruby on Rails, Catalyst or other ty +pe of easy-to-use and easy-to-setup BREAD applications. BREAD (oh how + we love acronyms) stands for Browse, Read, Edit, Add and Delete. CRU +D (Create, Retrieve, Update and Delete) also suffices, but BREAD just + sounds better. Either way you slice it (pun intended), this Plugin w +ill allow you to setup a database management tool for your users in n +o time.] [bread_db This method points the BREAD plugin to what database to work with. The +re's a lot of flexibility in the parameter choices. You can provide a +n array reference of Class::DBI classes or Class::DBI::Loader. This m +ethod will inspect your parameter by looking at its reference.]
Incomprehensible, inappropriate or dubious
DBIx::Web Active Web Database Layer DBIx-Web-0.62 - 30 Jun 2006 - Andrew V. Makarow
DBIx::Browse::CGI Perl extension to browse tables with a CGI interface. DBIx-Browse-2.09 - 10 Dec 2002 - Evilio Jose del Rio Silvan
[I couldn't find a module called DBIx::HTML which is strange but I fou +nd] DBIx::HTML::LinkedMenus Convert SQL to 2 linked HTML popup menus. DBIx::HTML::PopupRadio Convert sql into a popup menu or radio group. DBIx::HTML::ClientDB Convert sql into a client-side db with keyed access. All by - Ron Savage ::
DBIx::CGI Easy to Use DBI interface for CGI scripts DBIx-CGI-0.06 - 24 Dec 1999 - Stefan Hornburg
DBIx::CGITables 0.001 - Easy DB access from a CGI DBIx-CGITables-0.001 - 26 Feb 2000 - Tobias Brox [This module is under development - and this version is not tested ver +y well.]
DBIx::HTMLTable Create HTML table from DBI query output. DBIx-HTMLTable-0.24 - 17 Mar 2004 - Robert Kiesling [Note: may be useful for just presenting search results]

Update 11 Sep

John Siracusa has pointed out that Rose::HTML::Objects is another alternative.

Rose::HTML::Objects Object-oriented interfaces for HTML. Rose-HTML-Objects-0.53 - 14 Jun 2006 - John Siracusa

Replies are listed 'Best First'.
Re: DBIx-compatible module to use for CGI CRUD/BREAD?
by perrin (Chancellor) on Sep 10, 2006 at 15:51 UTC
    Just a little nomenclature thing here: "DBIx" in the title of a module does not refer to DBIx::Class. It means that this is a DBI extension of some kind. To find DBIx::Class struff, you'll have to search for the whole string "DBIx::Class" (or maybe "DBIC" in some cases).
Re: DBIx-compatible module to use for CGI CRUD/BREAD?
by aquarium (Curate) on Sep 10, 2006 at 10:08 UTC
    i know what CRUD is: Create, Read, Update, Delete.
    what is BREAD?..apart from being food.
    the hardest line to type correctly is: stty erase ^H
Re: DBIx-compatible module to use for CGI CRUD/BREAD?
by aquarium (Curate) on Sep 10, 2006 at 23:45 UTC
    Looks like Formbuilder is the only mature and actively supported module from your pick of 3. If you don't run into major issues during prototyping, then i would choose Formbuilder on these merits. You also get good state handling, which is a bonus. Not sure how easy (or otherwise) it is to customize Formbuilder look/workflow.
    the hardest line to type correctly is: stty erase ^H
      Thanks, that's exactly the sort of evaluation I was hoping for. The only other contender that has turned up from a couple of people is CGI::Application with an appropriate plugin. I'm a bit vague about this.

      I had dismissed CGI::Application::Plugin::BREAD because it seemed to be based on CDBI instead of DBIC. Was this unwise?

      Or does anyone know of a suitable plugin?

Re: DBIx-compatible module to use for CGI CRUD/BREAD?
by ait (Hermit) on Sep 11, 2006 at 02:01 UTC
    Hi. Just IMHO If you are looking into these matters in Perl I would recommend that you take a look at Catalyst and do the whole tutorial (it will take you about 2 hours each chapter if you really sit down and understand what is going on). You will see many of these things integrated in to a RAD environment and will teach you a lot about Perl for the Web, and Perl best practices in general. It's really, really cool.

    The pain is probably installing it, but once you get it going do:
    perldoc Catalyst::Manual::Tutorial
      Well yes, thanks but please see my separate thread on Catalyst in which the conclusion seems to be that Catalyst would be both difficult and also veering on the "sledgehammer to crack a nut" side.
Re: DBIx-compatible module to use for CGI CRUD/BREAD?
by zby (Vicar) on May 15, 2008 at 12:38 UTC
Re: DBIx-compatible module to use for CGI CRUD/BREAD?
by zby (Vicar) on Sep 13, 2006 at 07:02 UTC
    There is also Catalyst::Example::InstantCRUD - actually the DBIx::Class::InstantCRUD you mention is just an internal module of the former. My goal when writing Instant was to have something that generates the CRUD/BREAD code with minimal configuration. It's still work in progress but should work for many scenarios - the main problem are the dependencies.

Log In?

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: perlquestion [id://572200]
Approved by shmem
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others chilling in the Monastery: (6)
As of 2022-05-20 15:01 GMT
Find Nodes?
    Voting Booth?
    Do you prefer to work remotely?

    Results (73 votes). Check out past polls.