r8893: initial openmcl port
authorKevin M. Rosenberg <kevin@rosenberg.net>
Fri, 9 Apr 2004 01:41:26 +0000 (01:41 +0000)
committerKevin M. Rosenberg <kevin@rosenberg.net>
Fri, 9 Apr 2004 01:41:26 +0000 (01:41 +0000)
ChangeLog
TODO
db-postgresql-socket/postgresql-socket-api.lisp

index 348d919affe2516bd7fb64e46c707c73039e0ff8..39957cd302a60ff5eb227750b5a4716ede71fcf6 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -10,7 +10,7 @@
        * db-sqlite/sqlite-api-{uffi,sql}.lisp: Multiple UFFI fixes,
        now passes tests on all support UFFI platforms.
        * db-postgresql-socket/postgresql-socket-api.list: Ported to 
-       SBCL
+       SBCL and OpenMCL
        * multiple: Finish renaming of :types keyword to :result-types for
        greater CommonSQL compatibility, including documentation
        * sql/basic-cmds.lisp: Remove obsolete file
diff --git a/TODO b/TODO
index 1b031763174e24aab28ed0b9edbdd72c3c5fecbc..977095af2f58fce3825ce9b494bb1650ac054889 100644 (file)
--- a/TODO
+++ b/TODO
@@ -4,7 +4,6 @@ GENERAL
   individuals;
 * implement remaining functions for CLSQL AODBC backend;
 * port Oracle and ODBC backend to UFFI.
-* port postgresql-socket backend to OpenMCL
 
 COMMONSQL SPEC
 
index 572e5cf7b16794caee2dd2934031c75f0d7cef0c..a1283951c30b0f6afbdc83f6c59517d94d044ab3 100644 (file)
@@ -375,6 +375,23 @@ socket interface"
                               :remote-port port :remote-host host
                               :connect :active :nodelay t))))))
 
+#+openmcl
+(defun open-postgresql-socket-stream (host port)
+  (etypecase host
+    (pathname
+     (let ((path (namestring
+                 (make-pathname :name ".s.PGSQL" :type (princ-to-string port)
+                                :defaults host))))
+       (ccl:make-socket :type :stream :address-family :file
+                       :connect :active
+                       :remote-filename path :local-filename path)))
+    (string
+     (socket:with-pending-connect
+        (mp:with-timeout (*postgresql-server-socket-timeout* (error "connect failed"))
+          (ccl:make-socket :type :stream :address-family :internet
+                           :remote-port port :remote-host host
+                           :connect :active :nodelay t))))))
+
 #+lispworks
 (defun open-postgresql-socket-stream (host port)
   (etypecase host