;;;; Programmers: Kevin M. Rosenberg and onShore Development Inc
;;;; Date Started: Mar 2002
;;;;
-;;;; $Id: usql.cl,v 1.3 2002/04/06 19:54:15 kevin Exp $
+;;;; $Id: usql.cl,v 1.6 2002/04/07 15:11:21 kevin Exp $
;;;;
;;;; This file, part of CLSQL, is Copyright (c) 2002 by Kevin M. Rosenberg
;;;; and onShore Development Inc
(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
(defun sequence-next (name &key (database *default-database*))
(database-sequence-next name database))
-(defclass sql-typecast-exp (sql-value-exp)
- ()
- (:documentation
- "An SQL typecast expression.")
- )
-
(defclass sql-value-exp (%sql-expression)
((modifier
:initarg :modifier
"An SQL value expression.")
)
+(defclass sql-typecast-exp (sql-value-exp)
+ ()
+ (:documentation
+ "An SQL typecast expression.")
+ )
(defvar +null-string+ "NULL")
(defvar *sql-stream* nil
"stream which accumulates SQL output")
-(defclass %sql-expression ()
- ())
-
(defmethod output-sql ((expr %sql-expression) &optional
(database *default-database*))
(declare (ignore database))
(self stream :type t)
(write-string (sql-output self) stream)))
+
+;; Methods for translating high-level table classes to low-level functions
+
+(defmethod database-list-attributes ((table sql-ident) database)
+ (database-list-attributes (string-downcase
+ (symbol-name (slot-value table 'name)))
+ database)
+ )
+
+(defmethod database-attribute-type (attribute (table sql-ident) database)
+ (database-attribute-type attribute (string-downcase
+ (symbol-name (slot-value table 'name)))
+ database))