r1767: Moved high-level types to clsql-sys
authorKevin M. Rosenberg <kevin@rosenberg.net>
Sun, 7 Apr 2002 15:11:04 +0000 (15:11 +0000)
committerKevin M. Rosenberg <kevin@rosenberg.net>
Sun, 7 Apr 2002 15:11:04 +0000 (15:11 +0000)
interfaces/mysql/mysql-usql.cl
interfaces/postgresql/postgresql-usql.cl

index 13d3b2f147c1593d994809e201751e57fd1b4dd8..10413a66a2fdb6538b07e43747b5292bb2010b2a 100644 (file)
@@ -7,7 +7,7 @@
 ;;;; Programmers:   Kevin M. Rosenberg and onShore Development Inc
 ;;;; Date Started:  Mar 2002
 ;;;;
-;;;; $Id: mysql-usql.cl,v 1.2 2002/04/03 04:54:17 kevin Exp $
+;;;; $Id: mysql-usql.cl,v 1.3 2002/04/07 15:11:04 kevin Exp $
 ;;;;
 ;;;; This file, part of CLSQL, is Copyright (c) 2002 by Kevin M. Rosenberg
 ;;;; and by onShore Development Inc.
   (mapcar #'car (database-query "show tables" database :auto)))
     
 
-(defmethod database-list-attributes (table (database mysql-database))
-  (let* ((relname (etypecase table
-                   (clsql::sql-ident
-                    (string-downcase
-                     (symbol-name (slot-value table 'clsql::name))))
-                   (string table)))
-        (result
-         (mapcar #'car
-                 (database-query
-                  (format nil
-                          "SHOW COLUMNS FROM ~A" relname)
-                  database nil))))
-    result)) ;; MySQL returns columns in reverse order defined
 
-(defmethod database-attribute-type (attribute table
+(defmethod database-list-attributes ((table string) (database mysql-database))
+  (mapcar #'car
+         (database-query
+          (format nil "SHOW COLUMNS FROM ~A" table)
+          database nil)))
+
+(defmethod database-attribute-type (attribute (table string)
                                    (database mysql-database))
-  (let* ((relname (etypecase table
-                   (clsql::sql-ident
-                    (string-downcase
-                     (symbol-name (slot-value table 'clsql::name))))
-                   (string table)))
-        (result
+  (let ((result
          (mapcar #'cadr
                  (database-query
                   (format nil
-                          "SHOW COLUMNS FROM ~A LIKE '~A'" relname attribute)
+                          "SHOW COLUMNS FROM ~A LIKE '~A'" table attribute)
                   database nil))))
     (let* ((str (car result))
           (end-str (position #\( str))
index 25eb696aaf10c8292313773812be87032eca7ffe..692bcde4f6cb4422341dec6a59e384250fa0fa38 100644 (file)
@@ -7,7 +7,7 @@
 ;;;; Programmers:   Kevin M. Rosenberg and onShore Development Inc
 ;;;; Date Started:  Mar 2002
 ;;;;
-;;;; $Id: postgresql-usql.cl,v 1.1 2002/04/01 05:27:55 kevin Exp $
+;;;; $Id: postgresql-usql.cl,v 1.2 2002/04/07 15:11:04 kevin Exp $
 ;;;;
 ;;;; This file, part of CLSQL, is Copyright (c) 2002 by Kevin M. Rosenberg
 ;;;; and by onShore Development Inc.
 
 
 
-(defmethod database-list-attributes (table (database postgresql-database))
-  (let* ((relname (etypecase table
-                   (clsql::sql-ident
-                    (string-downcase
-                     (symbol-name (slot-value table 'clsql::name))))
-                   (string table)))
-        (result
+(defmethod database-list-attributes ((table string)
+                                    (database postgresql-database))
+  (let* ((result
          (mapcar #'car
                  (database-query
                   (format nil
@@ -57,7 +53,7 @@
                                                "tableoid") :test #'equal)) 
                    result)))))
 
-(defmethod database-attribute-type (attribute table
+(defmethod database-attribute-type (attribute (table string)
                                    (database postgresql-database))
   (let ((result
          (mapcar #'car