I've made a few changes to Postmodern. They both try to do a little magic in 
the case where a table has a single primary key column. The first change allows 
you to use a DAO-OBJECT directly as a parameter, rather than pulling out the 
key field. EG:

> (select-dao 'foo (:= 'bar bar))

instead of having to do

> (select-dao 'foo (:= 'bar (id bar)))

And the second allows the use of a DAO-CLASS name in the :COL-TYPE field of a 
slot definition. EG:

> (defclass bar () ((id :col-type serial)) (:metaclass dao-class))
> (defclass foo () ((bar :col-type (or db-null bar))) (:metaclass dao-class))

instead of

> (defclass bar () ((id :col-type serial)) (:metaclass dao-class))

> (defclass foo () ((bar :col-type (or db-null integer))) (:metaclass 
> dao-class))


These both seem pretty basic, but they mean that you can change the primary key 
column name or type without having to make changes throughout your code. Also, 
I see it as a first step toward being able to (eagerly or lazily) auto-populate 
slots with full objects rather than keys.

Does this seem useful, too magical, or already there but I missed it?

Attachment: single-key.patch
Description: Binary data

_______________________________________________
postmodern-devel mailing list
postmodern-devel@common-lisp.net
http://lists.common-lisp.net/cgi-bin/mailman/listinfo/postmodern-devel

Reply via email to