r9003: odbc updates
[clsql.git] / db-odbc / odbc-sql.lisp
index bcde3fcd0dd618c167a4e7421fcfab7aebfb67f8..a92e6feeca8bd7462d3c81fa60d3fdd9351342f5 100644 (file)
               :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)