Forum OpenACS Development: Re: Notes from OpenACS 6 Design Discussion in Heidelberg

Collapse
Posted by Tom Jackson on

This is what my query-writer does: takes object name, attributes, etc. and generates the entire pl/sql or plpgsql for creating the object type plus insert/update/delete plpgsql. One problem with plpgsql pl/sql is that you have to drop and reload the functions before things work. It also now has an option to just use tcl/dml statements (plus a tcl layer acs_object.create function). The tcl/dml option (per object) allows you to just alter your datamodel, add the field to query-writer, and the insert/update code keeps up. Query-writer only works on objects directly derived from acs_objects. It also has hooks for callbacks in certain places, like after parameter validation, after the regular dml/pl is executed, etc.

One thing I have found difficult to make easy is to move objects created on one system to another one. Ofcourse this is only done by the developer, but takes a few minutes and a little checking to make sure it is done right. Having a file dump format for your objects is an essential feature.

On pg, query-writer now has a wizard where you just supply the table name to begin. It queries the system tables to figure out what columns need to be added, and walks you through the process. Takes about five minutes to get a table working, even if it isn't an object_type table.