[Cl-perec-devel] Schema evolution: handling of initforms

Levente Mészáros levente.meszaros at gmail.com
Thu Aug 28 11:18:18 UTC 2008

> It's pretty simple if the initform shall be evaluated at
> column recomputation (persistence/class.lisp::compute-columns).
> If we want to evaluate the initform at ALTER TABLE time, though
> (which I suggest), we need to do something about the DEFAULT-VALUE
> slot of class SQL-COLUMN (cl-rdbms/syntax/create-table.lisp),
> making it hold a form that is evaluated before use.
> What do you think?
I have no objections putting a lambda or function into the
DEFAULT-VALUE of SQL-COLUMN in perec and have it called in rdbms when
altering the table or adding the column. On the other hand putting a
lisp form and calling eval on it is not a good idea.

Also, don't forget that you need to pass the result of the initform to
the writer function of the slot to get the RDBMS values (a lisp value
may be mapped to multiple rdbms columns). I guess putting these
lambdas into compute-columns is ok.

There's no perfectoin

More information about the cl-perec-devel mailing list