-(defun add-attribute (table attribute &key (database *default-database*))
- "Add the ATTRIBUTE to TABLE. The ATTRIBUTE sepcification must
-include a type argument. The optional keyword argument :database
-specifies the database to operation on, defaulting to
-*default-database*."
- (database-add-attribute table attribute database))
-
-(defun rename-attribute (table oldatt newname
- &key (database *default-database*))
- (error "(rename-attribute ~a ~a ~a ~a) is not implemented" table oldatt newname database))
-
-
-(defclass %sql-expression ()
- ())
-
-;; For SQL Identifiers of generic type
-(defclass sql-ident (%sql-expression)
- ((name
- :initarg :name
- :initform "NULL"))
- (:documentation "An SQL identifer."))
-
-(defmethod make-load-form ((sql sql-ident) &optional environment)
- (declare (ignore environment))
- (with-slots (name)
- sql
- `(make-instance 'sql-ident :name ',name)))
-
-
-;; KMR -- change aref to more specific char
-(defun sql-escape (identifier)
- (let* ((unescaped (etypecase identifier
- (symbol (symbol-name identifier))
- (string identifier)))
- (escaped (make-string (length unescaped))))
- (dotimes (i (length unescaped))
- (setf (char escaped i)
- (cond ((equal (char unescaped i) #\-)
- #\_)
- ;; ...
- (t
- (char unescaped i)))))
- escaped))
-
-