r9831: * db-aodbc/aodbc-sql.lisp: Fix storage location
[clsql.git] / sql / db-interface.lisp
index 698b235333848e0dc6d3813fdbc4d7bd8310c808..cc5328728b1b9da4d1f53961d0a07e0c08e72c3c 100644 (file)
@@ -128,12 +128,6 @@ if not found. May signal an error if unable to communicate with database server.
     (signal-no-database-error database))
   (:documentation "Remove all data from database."))
 
-(defgeneric database-describe-table (database table)
-  (:method ((database t) table)
-    (declare (ignore table))
-    (signal-no-database-error database))
-  (:documentation "Return a list of name/type for columns in table"))
-
 (defgeneric database-destory (connection-spec type)
   (:documentation
    "Destroys a database, returns T if successfull or signals an error
@@ -178,6 +172,10 @@ the given lisp type and parameters."))
 
 (defgeneric database-list-tables (database &key owner)
   (:documentation "List all tables in the given database")
+  (:method ((database database) &key owner)
+          (declare (ignore owner))
+          (warn "database-list-tables not implemented for database type ~A."
+                (database-type database)))
   (:method ((database t) &key owner)
           (declare (ignore owner))
           (signal-no-database-error database)))
@@ -192,24 +190,40 @@ the given lisp type and parameters."))
  
 (defgeneric database-list-views (database &key owner)
   (:documentation "List all views in the DATABASE.")
+  (:method ((database database) &key owner)
+          (declare (ignore owner))
+          (warn "database-list-views not implemented for database type ~A."
+                (database-type database)))
   (:method ((database t) &key owner)
           (declare (ignore owner))
           (signal-no-database-error database)))
 
 (defgeneric database-list-indexes (database &key owner)
   (:documentation "List all indexes in the DATABASE.")
-  (:method ((database t) &key owner)
+  (:method ((database database) &key owner)
           (declare (ignore owner))
-          (signal-no-database-error database)))
+          (warn "database-list-indexes not implemented for database type ~A."
+                (database-type database)))
+  (:method ((database t) &key owner)
+    (declare (ignore owner))
+    (signal-no-database-error database)))
 
 (defgeneric database-list-table-indexes (table database &key owner)
   (:documentation "List all indexes for a table in the DATABASE.")
+  (:method (table (database database) &key owner)
+          (declare (ignore table owner))
+          (warn "database-list-table-indexes not implemented for database type ~A."
+                (database-type database)))
   (:method (table (database t) &key owner) 
           (declare (ignore table owner))
           (signal-no-database-error database)))
 
 (defgeneric database-list-attributes (table database &key owner)
   (:documentation "List all attributes in TABLE.")
+  (:method (table (database database) &key owner)
+          (declare (ignore table owner))
+          (warn "database-list-attributes not implemented for database type ~A."
+                (database-type database)))
   (:method (table (database t) &key owner)
           (declare (ignore table owner))
           (signal-no-database-error database)))
@@ -217,18 +231,30 @@ the given lisp type and parameters."))
 (defgeneric database-attribute-type (attribute table database &key owner)
   (:documentation "Return the type of ATTRIBUTE in TABLE. Returns multiple values
 of TYPE_NAME (keyword) PRECISION SCALE NULLABLE.")
+  (:method (attribute table (database database) &key owner)
+          (declare (ignore attribute table owner))
+          (warn "database-list-attribute-type not implemented for database type ~A."
+                (database-type database)))
   (:method (attribute table (database t) &key owner)
           (declare (ignore attribute table owner))
           (signal-no-database-error database)))
 
 (defgeneric database-add-attribute (table attribute database)
   (:documentation "Add the attribute to the table.")
+  (:method (table attribute (database database))
+          (declare (ignore table attribute))
+          (warn "database-add-attribute not implemented for database type ~A."
+                (database-type database)))
   (:method (table attribute (database t))
           (declare (ignore table attribute))
           (signal-no-database-error database)))
 
 (defgeneric database-rename-attribute (table oldatt newname database)
   (:documentation "Rename the attribute in the table to NEWNAME.")
+  (:method (table oldatt newname (database database))
+          (declare (ignore table oldatt newname))
+          (warn "database-rename-attribute not implemented for database type ~A."
+                (database-type database)))
   (:method (table oldatt newname (database t))
           (declare (ignore table oldatt newname))
           (signal-no-database-error database)))
@@ -405,6 +431,4 @@ of TYPE_NAME (keyword) PRECISION SCALE NULLABLE.")
   (unless (is-database-open database)
     (signal-closed-database-error database)))
 
-(defgeneric describe-table (table &key database)
-  (:documentation "Describes a table, returns a list of name/type for columns in table"))