;;;; -*- Mode: LISP; Syntax: ANSI-Common-Lisp; Base: 10 -*-
;;;; *************************************************************************
;;;;
-;;;; $Id$
-;;;;
;;;; Classes defining SQL expressions and methods for formatting the
;;;; appropriate SQL commands.
;;;;
;; the next loop simply emits each sub-expression with the appropriate number of
;; parens and operators
(flet ((trim (sub)
- (string-trim '(#\space #\newline #\return #\tab
- ;; sbcl, allegrocl, and clisp use #\no-break_space
- ;; lispworks uses #\no-break-space
- #-lispworks #\no-break_space
- #+lispworks #\no-break-space
- )
+ (string-trim +whitespace-chars+
(with-output-to-string (*sql-stream*)
(output-sql sub database)))))
(let ((str-subs (loop for sub in sub-expressions
(cons (symbol-name-default-case "UNSIGNED") "UNSIGNED")
(cons (symbol-name-default-case "ZEROFILL") "ZEROFILL")
(cons (symbol-name-default-case "AUTO-INCREMENT") "AUTO_INCREMENT")
+ (cons (symbol-name-default-case "DEFAULT") "DEFAULT")
(cons (symbol-name-default-case "UNIQUE") "UNIQUE")))
(defmethod database-constraint-statement (constraint-list database)
:message (format nil "unsupported column constraint '~A'"
constraint))
(setq string (concatenate 'string string (cdr output))))
+ (when (equal (symbol-name (car constraint)) "DEFAULT")
+ (setq constraint (cdr constraint))
+ (setq string (concatenate 'string string " " (car constraint))))
(if (< 1 (length constraint))
(setq string (concatenate 'string string " "))))))))