X-Git-Url: http://git.kpe.io/?a=blobdiff_plain;f=db-aodbc%2Faodbc-sql.lisp;h=18a23841353ad4a5846a14d5371599bd6ef0d6d4;hb=86440ca219f801a087ad917d1c1f46c77c920aa4;hp=7d49c7d22ad5e12b60a90754e6528c4220e0ab43;hpb=23b76563b25a517ad20f29d6dc5a65c8b958a042;p=clsql.git diff --git a/db-aodbc/aodbc-sql.lisp b/db-aodbc/aodbc-sql.lisp index 7d49c7d..18a2384 100644 --- a/db-aodbc/aodbc-sql.lisp +++ b/db-aodbc/aodbc-sql.lisp @@ -37,7 +37,8 @@ ;; AODBC interface (defclass aodbc-database (database) - ((aodbc-conn :accessor database-aodbc-conn :initarg :aodbc-conn))) + ((aodbc-conn :accessor database-aodbc-conn :initarg :aodbc-conn) + (aodbc-db-type :accessor database-aodbc-db-type :initform :unknown))) (defmethod database-name-from-spec (connection-spec (database-type (eql :aodbc))) @@ -184,9 +185,8 @@ (defmethod database-list-sequences ((database aodbc-database) &key (owner nil)) (declare (ignore owner)) - (mapcar #'(lambda (s) (%table-name-to-sequence-name (car s))) - (database-query "SHOW TABLES LIKE '%clsql_seq%'" - database nil))) + (warn "database-list-sequences not implemented for AODBC.") + nil) (defmethod database-list-tables ((database aodbc-database) &key (owner nil)) @@ -202,6 +202,20 @@ (string-equal "TABLE" (nth 3 row))) collect (nth 2 row)))) +(defmethod database-list-views ((database aodbc-database) + &key (owner nil)) + (declare (ignore owner)) + #+aodbc-v2 + (multiple-value-bind (rows col-names) + (dbi:list-all-database-tables :db (database-aodbc-conn database)) + (declare (ignore col-names)) + ;; TABLE_SCHEM is hard-coded in second column by ODBC Driver Manager + ;; TABLE_NAME in third column, TABLE_TYPE in fourth column + (loop for row in rows + when (and (not (string-equal "information_schema" (nth 1 row))) + (string-equal "VIEW" (nth 3 row))) + collect (nth 2 row)))) + (defmethod database-list-attributes ((table string) (database aodbc-database) &key (owner nil)) (declare (ignore owner)) @@ -224,6 +238,11 @@ (loop for row in rows collect (nth pos row)))))) +(defmethod database-list-indexes ((database aodbc-database) + &key (owner nil)) + (warn "database-list-indexes not implemented for AODBC.") + nil) + (defmethod database-set-sequence-position (sequence-name (position integer) (database aodbc-database)) @@ -275,6 +294,9 @@ ;;; Backend capabilities +(defmethod database-underlying-type ((database aodbc-database)) + (database-aodbc-db-type database)) + (defmethod db-backend-has-create/destroy-db? ((db-type (eql :aodbc))) nil)