A table action is an SQL prepared statement created with $n notation for variables ($1,$2,). There is a list of fieldnames, the value for each is extracted from the HTTP post data and placed in the correct slot for the prepared statement. A list of primary key attributes may be specified. On form generation, these will be presented as read only fields.
A form name and an action specify a table action. When the form is created, a handler is specified. Each handler has its own set of supported actions.
- list is the main starting point for managing the data. It should select only a few attributes. Each row from the DB table will be a row in the HTML table with an edit button to update that row.
- An SQL command that creates data for a new record
without necessarily updating the db. Frequently
this is done as
SELECT ''::text someattribute
but can also be a call to a PLSQL script
SELECT someattribute FROM somefunction($1,$2)
- Insert one new record after create has presented it and the user hits submit on their form.
- Presents one row of the table for editing.
- Updates one record after edit has presented it and the user hits submit on their form.
- Delete one row. The fieldnames almost always should be the primary key.
- A select statement that returns all the rows and attributes to be edited. The data will be presented in an HTML table.
- In most cases, this is a no-op. It must exist so that the save
button on the users page has a corresponding action. Commonly
or other mindless nothing.
- A command to insert one row. If not present, then the "Add Row" button will not be on the edit page.
- A command to update one row.
- A command to delete one row. If not present, then the "Delete" button will not be on the edit page.
- The view action is a a no-op.
Its existence enables a menu page.
A menu, which is a set of menu items, can exist on any form page. The menu handler is unique not for what it does, but in that it does nothing else except hold menus.
- Unlike onetable and grid, the fs handler has no way to handle
attributes other than the following:
- filename - no spaces or funny symbols
- modtime - timestamp
- etag - a 64 bit unsigned integer that changes on every update.
- data - The contents of the file as one string of bytes, no nulls.
- Return just the etag. This is tied to an "if modified" HTTP request to preserve cache coherency.