r9403: Rework conditions to be CommonSQL backward compatible
[clsql.git] / sql / db-interface.lisp
index 84702b9c940e7170c69beb23ae01d57c8e284f5e..385e08ba07b7b0811b11f5a29f03f16228b4e040 100644 (file)
@@ -85,7 +85,7 @@ implications, since many databases will require the query to be
 executed in full to answer this question.  If the query produced no
 results then nil is returned for all values that would have been
 returned otherwise.  If an error occurs during query execution, the
-function should signal a clsql-sql-error."))
+function should signal a sql-database-data-error."))
 
 (defgeneric database-dump-result-set (result-set database)
   (:method (result-set (database t))
@@ -158,13 +158,19 @@ if unable to destory."))
   (:documentation "Select the last value in sequence NAME in DATABASE."))
 
 (defgeneric database-start-transaction (database)
-  (:documentation "Start a transaction in DATABASE."))
+  (:documentation "Start a transaction in DATABASE.")
+  (:method ((database t))
+          (signal-no-database-error database)))
 
 (defgeneric database-commit-transaction (database)
-  (:documentation "Commit current transaction in DATABASE."))
+  (:documentation "Commit current transaction in DATABASE.")
+  (:method ((database t))
+          (signal-no-database-error database)))
 
 (defgeneric database-abort-transaction (database)
-  (:documentation "Abort current transaction in DATABASE."))
+  (:documentation "Abort current transaction in DATABASE.")
+  (:method ((database t))
+          (signal-no-database-error database)))
 
 (defgeneric database-get-type-specifier (type args database)
   (:documentation "Return the type SQL type specifier as a string, for
@@ -218,6 +224,13 @@ of TYPE_NAME (keyword) PRECISION SCALE NULLABLE."))
           t)
   (:documentation "T [default] if database-type supports views."))
 
+(defgeneric db-type-has-bigint? (db-type)
+  (:method (db-type)
+          (declare (ignore db-type))
+          ;; SQL92 has bigint
+          t)
+  (:documentation "T [default] if database-type supports bigint."))
+
 (defgeneric db-type-default-case (db-type)
   (:method (db-type)
           (declare (ignore db-type))
@@ -244,6 +257,12 @@ of TYPE_NAME (keyword) PRECISION SCALE NULLABLE."))
           t)
   (:documentation "T [default] if database-type supports boolean WHERE clause, such as 'WHERE MARRIED'."))
 
+(defgeneric db-type-has-union? (db-type)
+  (:method (db-type)
+          (declare (ignore db-type))
+          t)
+  (:documentation "T [default] if database-type supports boolean UNION."))
+
 (defgeneric db-backend-has-create/destroy-db? (db-type)
   (:method (db-type)
           (declare (ignore db-type))