* db-aodbc/aodbc-sql.lisp: Filter driver manager
"information_schema" tables from LIST-TABLES
* tests/test-basic.lisp: Remove table after testing
-
+ * tests/test-fddl.lisp: Test LIST-TABLE-INDEXES
+ * base/db-interface.lisp: Add DATABASE-UNDERLYING-TYPE
+ which gets the underlying type of database -- required
+ when dealing with ODBC databases and want to query
+ database capabilities. Added DB-USE-COLUMN-ON-DROP-TABLES?
+ as first database-backend specific feature. Is T on
+ :mysql, NIL on other backends. Change DROP-TABLE to
+ query this.
+
19 Apr 2004 Kevin Rosenberg (kevin@rosenberg.net)
* Version 2.8.2: Build changes for FreeBSD [Slawek Zak]
(connection-spec :initform nil :initarg :connection-spec
:reader connection-spec
:documentation "Require to use connection pool")
- (database-type :initarg :database-type :reader database-type
- :initform :unknown)
+ (database-type :initarg :database-type :initform :unknown
+ :reader database-type)
(state :initform :closed :reader database-state)
(command-recording-stream :accessor command-recording-stream :initform nil)
(result-recording-stream :accessor result-recording-stream :initform nil)
;;; Database backend capabilities
-(defgeneric db-use-column-on-drop-index? (database)
+(defgeneric database-underlying-type (database)
(:method (database)
- (declare (ignore database))
+ (database-type database))
+ (:documentation "Returns the type of the underlying database. For ODBC, needs to query ODBC driver."))
+
+(defgeneric db-use-column-on-drop-index? (db-type)
+ (:method (db-type)
+ (declare (ignore db-type))
;; Standard SQL does not use column name on DROP INDEX
nil)
- (:documentation "NIL [default] lif database does not use column name on DROP INDEX."))
+ (:documentation "NIL [default] lif database-type does not use column name on DROP INDEX."))
;;; Large objects support (Marc Battyani)
#:database-probe
#:database-list
#:database-describe-table
-
+ #:database-underlying-type
+
#:database-list-tables
#:database-list-attributes
#:database-attribute-type
;;; Database capabilities
-(defmethod db-use-column-on-drop-index? ((database mysql-database))
+(defmethod db-use-column-on-drop-index? ((db-type (eql :mysql)))
t)
(when (clsql-base-sys:database-type-library-loaded :mysql)
:errno nil
:error "Connection failed")))))
+(defmethod database-underlying-type ((database odbc-database))
+ (odbc-db-type database))
+
(defun store-type-of-connected-database (db)
(let* ((odbc-conn (database-odbc-conn db))
(server-name (odbc-dbi::get-odbc-info odbc-conn odbc::$SQL_SERVER_NAME))
-cl-sql (2.8.3-1) unstable; urgency=low
+cl-sql (2.9.0-1) unstable; urgency=low
* New upstream
- -- Kevin M. Rosenberg <kmr@debian.org> Tue, 20 Apr 2004 09:40:20 -0600
+ -- Kevin M. Rosenberg <kmr@debian.org> Tue, 20 Apr 2004 17:37:40 -0600
cl-sql (2.8.2-1) unstable; urgency=low
(unless (index-exists-p index-name :database database)
(return-from drop-index)))
(:error t))
- (unless (db-use-column-on-drop-index? database)
+ (unless (db-use-column-on-drop-index? (database-underlying-type database))
(setq on nil))
(execute-command (format nil "DROP INDEX ~A~A" index-name
(if (null on) ""