+ (warn "database-list-sequences not implemented for AODBC.")
+ nil)
+
+(defmethod database-list-tables ((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 "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))
+ #+aodbc-v2
+ (multiple-value-bind (rows col-names)
+ (dbi:list-all-table-columns table :db (database-aodbc-conn database))
+ (let ((pos (position "COLUMN_NAME" col-names :test #'string-equal)))
+ (when pos
+ (loop for row in rows
+ collect (nth pos row))))))
+
+(defmethod database-attribute-type ((attribute string) (table string) (database aodbc-database)
+ &key (owner nil))
+ (declare (ignore owner))
+ #+aodbc-v2
+ (multiple-value-bind (rows col-names)
+ (dbi:list-all-table-columns table :db (database-aodbc-conn database))
+ (let ((pos (position "TYPE_NAME" col-names :test #'string-equal)))
+ (when pos
+ (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)