[postmodern-devel] Postmodern Store for Weblocks

Phil Marneweck zaries at global.co.za
Sat Nov 7 15:30:42 UTC 2009


Hi

I have completed the postmodern store I was working on and I am
including the code in this mail.

There are two "modes" that you can use the store in. The default is by
supplying your own unique ids for all tables in the db so that weblocks
can work. The second mode uses oid's to supply weblocks with unique ids.
To facilitate the use of oid's you will need the latest postmodern code
that has the :ghost functionality (clbuild retrieves this version).

Things to look at:

1. I create a new class based on dao-class called dao-store-class. I do
this to add the direct slot for foreign keys. Currently you need to pass
lists to this slot. If mop was used to create a slot-class for this it
could replace the lists. I am however far from comfortable with mop
(even after staring at the code in postmodern's table.lisp or maybe it
was because I looked at that as an example that I did not feel up to the
task). The other matter is that the handling of foreign keys might be
nice to add into postmodern itself.

2. I used strings to build some of the select statments. This is because
I could not get the syntax right to have a compile-sql use s-sql to
build these selects. See comments in code.

3. The unit tests I have written to test the store without weblocks are
really crappy and need to be redone to be lispy and to handle more
scenarios. Some of the tests dont clean up after themselves properly
when they fail so test can't be re-run without cleaning the db. The unit
tests also only test the OID version of the store.

I have tested the store (in default mode) with the weblocks store demo
code that I adjusted to work with the postmodern store and all scenarios
there work fine.

Any and all comments/code would be welcome. I am relatively new to lisp
and will remain relatively new for some time still to come. There is a
lot to learn and a lot I still need to practice. 

Regards

-------------- next part --------------
A non-text attachment was scrubbed...
Name: postmodern.tar.gz
Type: application/x-compressed-tar
Size: 23898 bytes
Desc: not available
URL: <https://mailman.common-lisp.net/pipermail/postmodern-devel/attachments/20091107/d6ac42e3/attachment.bin>


More information about the postmodern-devel mailing list