[postmodern-devel] Inserting into related tables

Marijn Haverbeke marijnh at gmail.com
Fri Jan 4 15:52:19 UTC 2008


> (defun get-producer-id (name)
>  (or (query (:select 'id :from 'producer :where (:= 'name name)))
>        (let ((new-producer (make-instance 'producer :name name))
>              (insert-dao new-producer)
>              (get-id new-producer))))

(Actually, now that I think about it, this would probably not be
thread-safe. I'll see if I can figure out a better approach.)

Cheers,
Marijn



More information about the postmodern-devel mailing list