X-Git-Url: http://git.kpe.io/?p=clsql.git;a=blobdiff_plain;f=base%2Fdb-interface.lisp;h=3ddfd89c032e64741fbd3f949dddecc8166dc8ba;hp=9591c9c488495970b06952b87767c692a74e830d;hb=9bbed78051e80e6ab76ae47834136035602bbbf1;hpb=23b76563b25a517ad20f29d6dc5a65c8b958a042 diff --git a/base/db-interface.lisp b/base/db-interface.lisp index 9591c9c..3ddfd89 100644 --- a/base/db-interface.lisp +++ b/base/db-interface.lisp @@ -19,7 +19,7 @@ ;;;; (http://opensource.franz.com/preamble.html), also known as the LLGPL. ;;;; ************************************************************************* -(in-package #:clsql-base-sys) +(in-package #:clsql-base) (defgeneric database-type-load-foreign (database-type) (:documentation @@ -30,13 +30,6 @@ "The internal generic implementation for checking if database type library loaded successfully.")) -(defgeneric database-type (database) - (:documentation - "Returns database type") - (:method (database) - (signal-no-database-error database))) - - (defgeneric database-initialize-database-type (database-type) (:documentation "The internal generic implementation of initialize-database-type.")) @@ -59,9 +52,9 @@ was called with the connection-spec.")) (signal-no-database-error database)) (:documentation "Internal generic implementation of disconnect.")) -(defgeneric database-query (query-expression database result-types) - (:method (query-expression (database t) result-types) - (declare (ignore query-expression result-types)) +(defgeneric database-query (query-expression database result-types field-names) + (:method (query-expression (database t) result-types field-names) + (declare (ignore query-expression result-types field-names)) (signal-no-database-error database)) (:documentation "Internal generic implementation of query.")) @@ -193,7 +186,8 @@ the given lisp type and parameters.")) (:documentation "List all attributes in TABLE.")) (defgeneric database-attribute-type (attribute table database &key owner) - (:documentation "Return the type of ATTRIBUTE in TABLE.")) + (:documentation "Return the type of ATTRIBUTE in TABLE. Returns multiple values +of TYPE_NAME (keyword) PRECISION SCALE NULLABLE.")) (defgeneric database-add-attribute (table attribute database) (:documentation "Add the attribute to the table.")) @@ -224,6 +218,19 @@ the given lisp type and parameters.")) t) (:documentation "T [default] if database-type supports views.")) +(defgeneric db-type-default-case (db-type) + (:method (db-type) + (declare (ignore db-type)) + ;; By default, CommonSQL converts identifiers to UPPER case. + :upper) + (:documentation ":upper [default] if means identifiers mapped to UPPER case SQL like CommonSQL API. However, Postgresql maps identifiers to lower case, so PostgreSQL uses a value of :lower for this result.")) + +(defgeneric db-type-has-fancy-math? (db-type) + (:method (db-type) + (declare (ignore db-type)) + nil) + (:documentation "NIL [default] if database-type does not have fancy math.")) + (defgeneric db-type-has-subqueries? (db-type) (:method (db-type) (declare (ignore db-type)) @@ -233,7 +240,7 @@ the given lisp type and parameters.")) (defgeneric db-type-has-boolean-where? (db-type) (:method (db-type) (declare (ignore db-type)) - ;; SQL92 has boolean where + ;; SQL99 has boolean where t) (:documentation "T [default] if database-type supports boolean WHERE clause, such as 'WHERE MARRIED'.")) @@ -271,8 +278,8 @@ the given lisp type and parameters.")) (signal-closed-database-error database))) (defmethod database-query :before (query-expression (database database) - result-set) - (declare (ignore query-expression result-set)) + result-set field-names) + (declare (ignore query-expression result-set field-names)) (unless (is-database-open database) (signal-closed-database-error database)))