cocoon-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Donald Ball <ba...@webslingerZ.com>
Subject RE: SQLProcessor - attributes of the query tag?
Date Thu, 09 Mar 2000 00:16:45 GMT
On Fri, 3 Mar 2000, Terry Paddy wrote:

> 
> Hi Donald, I sort of answered my own question by looking at the source code
> namely the master_default_query_props, it's just that the SQLProcessor doc
> page says ... "A partial list of attributes is:" so I assumed that there
> were more.
> 
> The only extras I found in the source were
> count-attribute
> query-attribute
> update-rows-attribute
> session-variable-left-delimiter
> session-variable-right-delimiter
> 
> I haven't worked out what they do yet :-)

Aha, foolish me, I must update these docs. Okay, just for your edification
right now, count-, query-, and update-rows- attributes tell sqlprocessor
to add attributes whose names are the values of these attributes to the
result doc-element, whose values are the number of rows returned, the
actual SQL query performed, and the number of rows updated (by a SQL
UPDATE, DELETE, etc.). So you might get:

<query count-attribute="count" query-attribute="query"...></query>

<rowset count="1" query="select name from foo_table where id = 23">
 <row>
  <name>Foo</name>
 </row>
</rowset>

The first two are to help you do pages where you iterate through a rowset;
the last is for those doing admin SQL stuff through SQLProcessor.

> While I have 'your ear', is there a way of updating a database from a XML
> file? Or do I have to write that functionality myself?

Weellll.... I have an SQLEditorProcessor that I wrote. It's horrid, nasty,
ugly code, but it _is_ functional, horrid, nasty, ugly code. It places
some contraints on how you must name tables and columns, though I think I
let you circumvent that through use of specially named meta tables. If you
want to take a look at it, I'll send it your way; I'd be happy to open the
source but wouldn't want to, uh, impose it upon anyone.

Oh, a couple of people at apachecon were bemoaning the lack of db pooling
in SQLProcessor. After being embarassed in person, I reckon I'll actually
get around to throwing one in. Does anyone have a preference for which
open source database pool we use? It will, of course, be completely
optional.

- donald


Mime
View raw message