[elephant-cvs] CVS elephant/src/db-clsql

ieslick ieslick at common-lisp.net
Sun Feb 19 05:13:02 UTC 2006


Update of /project/elephant/cvsroot/elephant/src/db-clsql
In directory common-lisp:/tmp/cvs-serv9084/src/db-clsql

Modified Files:
	sql-controller.lisp 
Log Message:
Minor changes for sql-backend

--- /project/elephant/cvsroot/elephant/src/db-clsql/sql-controller.lisp	2006/02/19 04:53:00	1.1
+++ /project/elephant/cvsroot/elephant/src/db-clsql/sql-controller.lisp	2006/02/19 05:13:02	1.2
@@ -19,7 +19,7 @@
 (in-package "ELEPHANT")
 
 (defpackage elephant-clsql
-  (:use :common-lisp :elephant :uffi))
+  (:use :common-lisp :elephant :elephant-memutil :uffi :elephant-backend :cl-base64))
 
 (in-package "ELEPHANT-CLSQL")
 
@@ -57,18 +57,17 @@
   'with-transaction-sql
   )
 
-(defun sql-store-spec-p (path)
-  (listp path))
+(defun sql-store-spec-p (spec)
+  (and (listp spec)
+       (eq (first spec) :clsql)))
 
 (defun sql-test-and-construct (spec)
   (if (sql-store-spec-p spec)
       (open-store-sql spec)
-      nil)
-  )
+      nil))
 
-(eval-when ( :load-toplevel)
-  (register-strategy 'sql-test-and-construct)
-  )
+(eval-when (:load-toplevel)
+  (register-backend-con-init :clsql 'sql-test-and-construct))
 
 (defmacro with-open-store-sql ((spec) &body body)
   "Executes the body with an open controller,
@@ -326,8 +325,8 @@
 			    (recover-fatal nil) 
 			    (thread t))
   (the sql-store-controller
-    (let* ((dbtype (car (:dbcn-spc sc)))
-	   (con (clsql:connect (cdr (:dbcn-spc sc))
+    (let* ((dbtype (car (second (:dbcn-spc sc))))
+	   (con (clsql:connect (cdr (second (:dbcn-spc sc)))
 ;; WARNING: This line of code forces us to use postgresql.
 ;; If this were parametrized upwards we could concievably try 
 ;; other backends.




More information about the Elephant-cvs mailing list