r11094: 03 Sep 2006 Kevin Rosenberg <kevin@rosenberg.net>
[clsql.git] / sql / db-interface.lisp
index cc5328728b1b9da4d1f53961d0a07e0c08e72c3c..10b25d93defb0bbd1c1325561669b4c271c723b8 100644 (file)
@@ -56,6 +56,10 @@ was called with the connection-spec."))
   (:method (query-expression (database t) result-types field-names)
           (declare (ignore query-expression result-types field-names))
           (signal-no-database-error database))
+  (:method (query-expression (database database) result-types field-names)
+            (declare (ignore query-expression result-types field-names))
+            (warn "database-query not implemented for database type ~A."
+                  (database-type database)))
   (:documentation "Internal generic implementation of query."))
 
 
@@ -63,6 +67,10 @@ was called with the connection-spec."))
   (:method (sql-expression (database t))
           (declare (ignore sql-expression))
           (signal-no-database-error database))
+  (:method (sql-expression (database database))
+          (declare (ignore sql-expression))
+          (warn "database-execute-command not implemented for database type ~A."
+                (database-type database)))
   (:documentation "Internal generic implementation of execute-command."))
 
 ;;; Mapping and iteration
@@ -72,6 +80,11 @@ was called with the connection-spec."))
           (declare (ignore query-expression full-set result-types))
           (signal-no-database-error database)
           (values nil nil nil))
+  (:method (query-expression (database database) &key full-set result-types)
+          (declare (ignore query-expression full-set result-types))
+          (warn "database-query-result-set not implemented for database type ~A."
+                (database-type database))
+          (values nil nil nil))
   (:documentation
    "Internal generic implementation of query mapping.  Starts the
 query specified by query-expression on the given database and returns
@@ -91,12 +104,20 @@ function should signal a sql-database-data-error."))
   (:method (result-set (database t))
           (declare (ignore result-set))
           (signal-no-database-error database))
+    (:method (result-set (database database))
+          (declare (ignore result-set))
+          (warn "database-dump-result-set not implemented for database type ~A."
+                (database-type database)))
   (:documentation "Dumps the received result-set."))
 
 (defgeneric database-store-next-row (result-set database list)
   (:method (result-set (database t) list)
           (declare (ignore result-set list))
           (signal-no-database-error database))
+    (:method (result-set (database database) list)
+          (declare (ignore result-set list))
+          (warn "database-store-next-row not implemented for database type ~A."
+                (database-type database)))
   (:documentation
    "Returns t and stores the next row in the result set in list or
 returns nil when result-set is finished."))
@@ -275,6 +296,12 @@ of TYPE_NAME (keyword) PRECISION SCALE NULLABLE.")
           nil)
   (:documentation "NIL [default] if database-type does not use column name on DROP INDEX."))
 
+(defgeneric db-type-use-fully-qualified-column-on-drop-index? (db-type)
+  (:method (db-type)
+          (declare (ignore db-type))
+          nil)
+  (:documentation "NIL [default] if database-type does not require fully qualified column name on DROP INDEX."))
+
 (defgeneric db-type-has-views? (db-type)
   (:method (db-type)
           (declare (ignore db-type))
@@ -338,6 +365,17 @@ of TYPE_NAME (keyword) PRECISION SCALE NULLABLE.")
     nil)
   (:documentation "T if database backend supports prepared statements."))
 
+(defgeneric db-type-has-intersect? (db-type)
+  (:method (db-type)
+          (declare (ignore db-type))
+          t)
+  (:documentation "T [default] if database-type supports INTERSECT."))
+
+(defgeneric db-type-has-except? (db-type)
+  (:method (db-type)
+          (declare (ignore db-type))
+          t)
+  (:documentation "T [default] if database-type supports EXCEPT."))
 
 ;;; Large objects support (Marc Battyani)
 
@@ -431,4 +469,11 @@ of TYPE_NAME (keyword) PRECISION SCALE NULLABLE.")
   (unless (is-database-open database)
     (signal-closed-database-error database)))
 
+(defvar *foreign-library-search-paths* nil
+  "A list of pathnames denoting directories where CLSQL will look
+for foreign libraries \(in addition to the default places).")
 
+(defun push-library-path (path)
+  "Adds the pathspec PATH \(which should denote a directory) to
+the list *FOREIGN-LIBRARY-SEARCH-PATHS*."
+  (pushnew path *foreign-library-search-paths* :test #'equal))