28 May
2009
28 May
'09
12:44 p.m.
I'm wanting to use the IF EXISTS modifier for the various DROP operations, and it seems like the semantics of CASCADE works best for this case. The following is a proof of concept implementation. If there aren't any issues or complaints I'll write a patch that covers the rest of the DROP operations. (defvar *expand-if-exists* nil) (defun expand-if-exists () (when *expand-if-exists* `("IF EXISTS "))) (def-sql-op :if-exists (op) (let ((*expand-if-exists* t)) (sql-expand op))) (def-sql-op :drop-sequence (name) `("DROP SEQUENCE " ,@(expand-if-exists) ,@(sql-expand name))) (sql (:if-exists (:drop-sequence 'sequence))) Cheers, -- Daniel White