Forum OpenACS Q&A: Re: Some tips about XoTcl development best practices

Collapse
Posted by Antonio Pisano on
Ok, fine with that.

There is something else that I still can't figure:
In apy doc, if i look at ::xo::db::sql::acs_attribute I get in the source code something that seems it has been auto-generated.

api-doc states that such method is defined in packages/xotcl-core/tcl/05-db-procs.tcl, but I can't grasp how: the code I can find there calls such proc, but the real definition seems to come from somewere else.

Collapse
Posted by Gustaf Neumann on
xotcl-core generates at startup automatically interfaces to all stored procedures in the database. For every package (in the oracle terminology) an object in the ::xo::db::sql namespace is generated. By calling e.g.
::xo::db::sql::acs_attribute create_attribute
one is calling actually in an postgres installation the stored procedure
acs_attribute__create_attribute
This interface is much faster than the usual OpenACS interface and allows to handle defaults for attribtues, give error messages about expected attributes, etc.

btw, i've updated xotcl-core once more, it should be now more backwards compatible (not tested), so you might not have to update nsf/nx.

all the best
-gn