[postmodern-devel] TRUNCATE missing

Nicolas Martyanoff khaelin at gmail.com
Sun May 22 09:12:50 UTC 2011


Marijn Haverbeke <marijnh at gmail.com> writes:

>> (def-sql-op :truncate (&rest args)
>>  (split-on-keywords ((tables *) (only - ?) (identity - ?) (fkey - ?))
>>      (cons :tables args)
>>    (let ((identity-str (case identity
>>                          (:restart-identity "RESTART IDENTITY ")
>>                          (:continue-identity "CONTINUE IDENTITY ")))
>
> Where are you expecting :restart-identity or :continue-identity to
> come from? An argumentless split-on-keywords arg will simply be T when
> given.
>
>>          (fkey-str (case fkey
>>                      (:cascade "CASCADE ")
>>                      (:restrict "RESTRICT "))))
>
> Same here -- you don't allow any arguments to :fkey.

I was expecting to be able to write forms such as:

  (:truncate 'foo 'bar :only :restrict)
  (:truncate 'foo :restart-identity :cascade)
  (:truncate 'foo)

Ie. without keyword arguments.

-- 
Nicolas Martyanoff
   http://codemore.org
   khaelin at gmail.com




More information about the postmodern-devel mailing list