X-Git-Url: http://git.kpe.io/?p=clsql.git;a=blobdiff_plain;f=sql%2Fusql.cl;h=1141dc0e1f33847f896b005f857c0866a3f1dd7d;hp=1a870984ff49907f5b681549ef91c4edf9a356ed;hb=998937376fa6f9ce29bd3c7954fb0ebca91c37d7;hpb=72f0ea8c6db74bd59809a9cd427969e85bfa0a78 diff --git a/sql/usql.cl b/sql/usql.cl index 1a87098..1141dc0 100644 --- a/sql/usql.cl +++ b/sql/usql.cl @@ -8,7 +8,7 @@ ;;;; Programmers: Kevin M. Rosenberg and onShore Development Inc ;;;; Date Started: Mar 2002 ;;;; -;;;; $Id: usql.cl,v 1.7 2002/05/19 16:05:23 kevin Exp $ +;;;; $Id: usql.cl,v 1.11 2002/09/17 17:16:43 kevin Exp $ ;;;; ;;;; This file, part of CLSQL, is Copyright (c) 2002 by Kevin M. Rosenberg ;;;; and onShore Development Inc @@ -45,35 +45,6 @@ keyword argument :database specifies the database to query, defaulting to *default-database*." (database-attribute-type attribute table database)) -(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))) - - (defun create-sequence (name &key (database *default-database*)) (database-create-sequence name database)) @@ -83,47 +54,4 @@ specifies the database to operation on, defaulting to (defun sequence-next (name &key (database *default-database*)) (database-sequence-next name database)) -(defclass sql-value-exp (%sql-expression) - ((modifier - :initarg :modifier - :initform nil) - (components - :initarg :components - :initform nil)) - (:documentation - "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") - -(defmethod output-sql ((expr %sql-expression) &optional - (database *default-database*)) - (declare (ignore database)) - (write-string +null-string+ *sql-stream*)) - -(defmethod print-object ((self %sql-expression) stream) - (print-unreadable-object - (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))