[cl-dwim-devel] Adding the concept of a natural key to perec

Levente Mészáros levente.meszaros at gmail.com
Mon Jul 1 07:52:59 UTC 2013


Sorry for the late answer, I've been on a holiday last week.

In general your patch seems to be all right. In the definition part I would
probably leave out the quote before the natural key's name. The issue you
mentioned could be easily solved by splitting the slot in the persistent
class into two. Also instead of generating different find functions you
could have one that is called like (find-by-natural-key 'ssn
:social-security-number ...)

I'm not entirely sure that this is a feature worth including as it is now.
It solves a very specific database constraint strongly related to RDBMS,
although I can see certain uses it. Also note that this feature should work
with multiple inheritance and various slot storage settings. e.g. what
happens if two slots of a natural key are stored in two tables? what about
abstract base classes? are natural keys inherited?

Once in the good old days we had the idea of implementing a generic object
oriented database constraint mechanisms (also used by the meta GUI) that
would optionally be compiled down to SQL indices, triggers, before commit
hooks as needed... but that was before we decided that we unfortunately
can't make a living from programming in common lisp.

Regards,
levy
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://mailman.common-lisp.net/pipermail/cl-dwim-devel/attachments/20130701/c1a8847c/attachment.html>


More information about the cl-dwim-devel mailing list