X-Git-Url: http://git.kpe.io/?a=blobdiff_plain;f=db-odbc%2Fodbc-sql.lisp;h=a92e6feeca8bd7462d3c81fa60d3fdd9351342f5;hb=a7e38685365a6cf067290843c0ed168b6fb545e9;hp=bcde3fcd0dd618c167a4e7421fcfab7aebfb67f8;hpb=8133ca7db26e719bb534c036207b7aba1d6a4b75;p=clsql.git diff --git a/db-odbc/odbc-sql.lisp b/db-odbc/odbc-sql.lisp index bcde3fc..a92e6fe 100644 --- a/db-odbc/odbc-sql.lisp +++ b/db-odbc/odbc-sql.lisp @@ -52,6 +52,26 @@ :errno nil :error "Connection failed"))))) +#+nil +(defun store-type-of-connected-database (db) + (let* ((odbc-db (odbc-db db)) + (server-name (get-odbc-info odbc-db odbc::$SQL_SERVER_NAME)) + (dbms-name (get-odbc-info odbc-db odbc::$SQL_DBMS_NAME)) + (type + ;; need SERVER-NAME and DBMS-NAME because many drivers mix this up + (cond + ((or (search "postgresql" server-name :test #'char-equal) + (search "postgresql" dbms-name :test #'char-equal)) + :postgresql) + ((or (search "mysql" server-name :test #'char-equal) + (search "mysql" dbms-name :test #'char-equal)) + :mysql) + ((or (search "oracle" server-name :test #'char-equal) + (search "oracle" dbms-name :test #'char-equal)) + :oracle)))) + (setf (database-type db) type))) + + (defmethod database-disconnect ((database odbc-database)) (odbc-dbi:disconnect (database-odbc-conn database)) (setf (database-odbc-conn database) nil)