r9549:
authorKevin M. Rosenberg <kevin@rosenberg.net>
Fri, 4 Jun 2004 20:07:15 +0000 (20:07 +0000)
committerKevin M. Rosenberg <kevin@rosenberg.net>
Fri, 4 Jun 2004 20:07:15 +0000 (20:07 +0000)
examples/clsql-tutorial.lisp

index 5d1ae7f7aed6ac93314752df9099f3db960443ac..7560f9a68d6f470987d4ab91acd66e50214f3ea9 100644 (file)
@@ -4,8 +4,8 @@
 
 ;; You must set these variables to appropriate values. 
 (defvar *tutorial-database-type* nil 
 
 ;; You must set these variables to appropriate values. 
 (defvar *tutorial-database-type* nil 
-  "Possible values are :postgresql,:postgresql-socket :mysql or :sqlite")
-(defvar *tutorial-database-name* ""
+  "Possible values are :postgresql,:postgresql-socket :mysql, :oracle, :odbc or :sqlite")
+(defvar *tutorial-database-name* "clsqltut"
   "The name of the database we will work in.")
 (defvar *tutorial-database-user* "" 
   "The name of the database user we will work as.")
   "The name of the database we will work in.")
 (defvar *tutorial-database-user* "" 
   "The name of the database user we will work as.")
 
 ;; Connect to the database (see the CLSQL documentation for vendor
 ;; specific connection specs).
 
 ;; Connect to the database (see the CLSQL documentation for vendor
 ;; specific connection specs).
-(clsql:connect `(,*tutorial-database-server* 
-              ,*tutorial-database-name*
-              ,*tutorial-database-user* 
-              ,*tutorial-database-password*)
-            :database-type *tutorial-database-type*)
+(case *tutorial-database-type*
+  ((:mysql :postgresql)
+   (clsql:connect `(,*tutorial-database-server* 
+                   ,*tutorial-database-name*
+                   ,*tutorial-database-user* 
+                   ,*tutorial-database-password*)
+                 :database-type *tutorial-database-type*))
+  ((:odbc :oracle)
+   (clsql:connect `(,*tutorial-database-name* 
+                   ,*tutorial-database-user* 
+                   ,*tutorial-database-password*)
+                 :database-type *tutorial-database-type*))
+  (:sqlite
+   (clsql:connect `(,*tutorial-database-name*)
+                 :database-type *tutorial-database-type*)))
 
 ;; Record the sql going out, helps us learn what is going
 ;; on behind the scenes
 
 ;; Record the sql going out, helps us learn what is going
 ;; on behind the scenes