X-Git-Url: http://git.kpe.io/?a=blobdiff_plain;f=sql%2Fusql.cl;h=2951dbccaff3836033648e00bbcecd4490efff28;hb=42a951e9f7152e7c145958f4dfed41d4e865c9fd;hp=c140fc40b6338f905a75d595b9830cb007c55fda;hpb=611b2d3ab3ef5f80b29f5352af2e5a5bf551ce99;p=clsql.git diff --git a/sql/usql.cl b/sql/usql.cl index c140fc4..2951dbc 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.5 2002/04/06 22:41:37 kevin Exp $ +;;;; $Id: usql.cl,v 1.9 2002/05/27 17:19:31 kevin Exp $ ;;;; ;;;; This file, part of CLSQL, is Copyright (c) 2002 by Kevin M. Rosenberg ;;;; and onShore Development Inc @@ -45,51 +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))) - - -;; 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)) - - (defun create-sequence (name &key (database *default-database*)) (database-create-sequence name database)) @@ -99,34 +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)))