r8975: remove schema versioning cruft
authorKevin M. Rosenberg <kevin@rosenberg.net>
Mon, 12 Apr 2004 18:12:36 +0000 (18:12 +0000)
committerKevin M. Rosenberg <kevin@rosenberg.net>
Mon, 12 Apr 2004 18:12:36 +0000 (18:12 +0000)
ChangeLog
Makefile
sql/classes.lisp
sql/metaclasses.lisp
sql/package.lisp
sql/table.lisp

index ac3e51724b8173773a24a1bfcc2c7845b2119a61..04cb77a88a311bdd0a78d1580eed2a7967acf403 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,11 @@
 12 Apr 2004 Kevin Rosenberg (kevin@rosenberg.net)
-       * Version 2.6.5
+       * Version 2.6.7
+       * sql/*.lisp: Remove schema versioning cruft
+       [Marcus Pearce]
+       * Makefile: Add classic subdirectory
+       
+12 Apr 2004 Kevin Rosenberg (kevin@rosenberg.net)
+       * Version 2.6.6
        * sql/sql.lisp: Fix TRUNCATE command, bug reported
        by Marcus Pearce
        * sql/sql.lisp: Remove EXPLAIN function. Postgresql/Oracle
index 1860a3a922d621c8fcdfc196bf43b391a3a49016..65c55e6d6ee9427e1d63e708db1ecac56b7bd5e8 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -7,7 +7,7 @@
 #
 #  CVS Id:   $Id$
 #
-# This file, part of CLSQL, is Copyright (c) 2002 by Kevin M. Rosenberg
+# This file, part of CLSQL, is Copyright (c) 2002-2004 by Kevin M. Rosenberg
 #
 # CLSQL users are granted the rights to distribute and use this software
 # as governed by the terms of the Lisp Lesser GNU Public License
@@ -15,7 +15,7 @@
 
 PKG    := clsql
 DEBPKG := cl-sql
-SUBDIRS        := sql tests uffi base db-mysql db-aodbc \
+SUBDIRS        := sql tests uffi base classic db-mysql db-aodbc \
           db-postgresql db-postgresql-socket db-sqlite
 DOCSUBDIRS:=doc
 
index a2ca8577727d6ac81a996514b935a30cb4b09639..5a22584f5f3e304ae8cd7758af2a93984e2ad2f7 100644 (file)
 (defvar *sql-stream* nil
   "stream which accumulates SQL output")
 
-(defvar *default-schema* "UNCOMMONSQL")
-
-(defvar *object-schemas* (make-hash-table :test #'equal)
-  "Hash of schema name to class constituent lists.")
-
-(defun in-schema (schemaname)
-  (setf *default-schema* schemaname))
-
 (defun sql-output (sql-expr &optional database)
   (progv '(*sql-stream*)
       `(,(make-string-output-stream))
index af8e461b774ba05b7e8fce2122642e630633b698..0efa327dd94e123518c96255ea9ffea797a970e2 100644 (file)
     :accessor object-definition
     :initarg :definition
     :initform nil)
-   (version
-    :accessor object-version
-    :initarg :version
-    :initform 0)
    (key-slots
     :accessor key-slots
     :initform nil)
@@ -117,7 +113,7 @@ of the default method.  The extra allowed options are the value of the
     result))
 
 #+lispworks
-(defconstant +extra-class-options+ '(:base-table :version :schemas))
+(defconstant +extra-class-options+ '(:base-table))
 
 #+lispworks 
 (defmethod clos::canonicalize-class-options :around
@@ -181,7 +177,7 @@ of the default method.  The extra allowed options are the value of the
 (defmethod initialize-instance :around ((class standard-db-class)
                                         &rest all-keys
                                        &key direct-superclasses base-table
-                                        schemas version qualifier
+                                        qualifier
                                        &allow-other-keys)
   (let ((root-class (find-class 'standard-db-object nil))
        (vmc (find-class 'standard-db-class)))
@@ -203,16 +199,12 @@ of the default method.  The extra allowed options are the value of the
                                                         (car base-table)
                                                         base-table))
                                                (class-name class)))))
-    (setf (object-version class) version)
-    (mapc (lambda (schema)
-            (pushnew (class-name class) (gethash schema *object-schemas*)))
-          (if (listp schemas) schemas (list schemas)))
     (register-metaclass class (nth (1+ (position :direct-slots all-keys))
                                    all-keys))))
 
 (defmethod reinitialize-instance :around ((class standard-db-class)
                                           &rest all-keys
-                                          &key base-table schemas version
+                                          &key base-table 
                                           direct-superclasses qualifier
                                           &allow-other-keys)
   (let ((root-class (find-class 'standard-db-object nil))
@@ -235,10 +227,6 @@ of the default method.  The extra allowed options are the value of the
                                                 direct-superclasses)
                   (remove-keyword-arg all-keys :direct-superclasses)))
         (call-next-method)))
-  (setf (object-version class) version)
-  (mapc (lambda (schema)
-          (pushnew (class-name class) (gethash schema *object-schemas*)))
-        (if (listp schemas) schemas (list schemas)))
   (register-metaclass class (nth (1+ (position :direct-slots all-keys))
                                  all-keys)))
 
index a6058c9a26a7fbbf7b755dbc2a12d1a710c9a429..63847d33033eb5414acc3e07dc88aaa1654ba769 100644 (file)
        #:command-recording-stream
        #:result-recording-stream
        #:database-view-classes
-       #:database-schema
        #:conn-pool
        #:print-object 
        ;; utils
        #:reload-database-types             ; clsql-base xx
        #:database-type                     ; database   x
        #:is-database-open
-       #:in-schema                         ; classes    x
        ;;FDDL 
        #:list-views                        ; table      xx
        #:view-exists-p                     ; table      xx
index fbff1755f37a443a846e00399e6686d1446df30e..4fb91685eff5e690b08ca954e33d3bab4c9d4f7b 100644 (file)
@@ -32,9 +32,6 @@
 
 ;; Tables 
 
-(defvar *table-schemas* (make-hash-table :test #'equal)
-  "Hash of schema name to table lists.")
-
 (defun create-table (name description &key (database *default-database*)
                           (constraints nil))
   "Create a table called NAME, in DATABASE which defaults to
@@ -48,8 +45,6 @@ a list containing lists of attribute-name and type information pairs."
                               :name table-name
                               :columns description
                               :modifiers constraints)))
-    (pushnew table-name (gethash *default-schema* *table-schemas*)
-             :test #'equal)
     (execute-command stmt :database database)))
 
 (defun drop-table (name &key (if-does-not-exist :error)
@@ -92,9 +87,6 @@ returned as a list of strings."
 
 ;; Views 
 
-(defvar *view-schemas* (make-hash-table :test #'equal)
-  "Hash of schema name to view lists.")
-
 (defun create-view (name &key as column-list (with-check-option nil)
                          (database *default-database*))
   "Creates a view called NAME using the AS query and the optional
@@ -111,7 +103,6 @@ is NIL. The default value of DATABASE is *DEFAULT-DATABASE*."
                               :column-list column-list
                               :query as
                               :with-check-option with-check-option)))
-    (pushnew view-name (gethash *default-schema* *view-schemas*) :test #'equal)
     (execute-command stmt :database database)))
 
 (defun drop-view (name &key (if-does-not-exist :error)
@@ -153,9 +144,6 @@ of strings."
 
 ;; Indexes 
 
-(defvar *index-schemas* (make-hash-table :test #'equal)
-  "Hash of schema name to index lists.")
-
 (defun create-index (name &key on (unique nil) attributes
                           (database *default-database*))
   "Creates an index called NAME on the table specified by ON. The
@@ -169,7 +157,6 @@ UNIQUE is nil. The default value of DATABASE is *DEFAULT-DATABASE*."
          (stmt (format nil "CREATE ~A INDEX ~A ON ~A (~{~A~^, ~})"
                        (if unique "UNIQUE" "")
                        index-name table-name attributes)))
-    (pushnew index-name (gethash *default-schema* *index-schemas*))
     (execute-command stmt :database database)))
 
 (defun drop-index (name &key (if-does-not-exist :error)
@@ -262,16 +249,11 @@ is the vendor-specific type returned by ATTRIBUTE-TYPE."
 
 ;; Sequences 
 
-(defvar *sequence-schemas* (make-hash-table :test #'equal)
-  "Hash of schema name to sequence lists.")
-
 (defun create-sequence (name &key (database *default-database*))
   "Create a sequence called NAME in DATABASE which defaults to
 *DEFAULT-DATABASE*."
   (let ((sequence-name (database-identifier name)))
-    (database-create-sequence sequence-name database)
-    (pushnew sequence-name (gethash *default-schema* *sequence-schemas*)
-             :test #'equal))
+    (database-create-sequence sequence-name database))
   (values))
 
 (defun drop-sequence (name &key (if-does-not-exist :error)