X-Git-Url: http://git.kpe.io/?a=blobdiff_plain;f=db-postgresql%2Fpostgresql-sql.lisp;h=ac13a3054deb0e178d2e9a4a0af496e911f94041;hb=cf0a1997b66f3e09e595c3c6fb04b08c0d2a4e61;hp=3bfac6b95ea24c933aeab34c1caf3d79aa9dcca4;hpb=7d50938ba2db52a713498e49aa1679deae6f0b6b;p=clsql.git diff --git a/db-postgresql/postgresql-sql.lisp b/db-postgresql/postgresql-sql.lisp index 3bfac6b..ac13a30 100644 --- a/db-postgresql/postgresql-sql.lisp +++ b/db-postgresql/postgresql-sql.lisp @@ -2,13 +2,13 @@ ;;;; ************************************************************************* ;;;; FILE IDENTIFICATION ;;;; -;;;; Name: postgresql-sql.sql +;;;; Name: postgresql-sql.lisp ;;;; Purpose: High-level PostgreSQL interface using UFFI ;;;; Programmers: Kevin M. Rosenberg based on ;;;; Original code by Pierre R. Mai ;;;; Date Started: Feb 2002 ;;;; -;;;; $Id: postgresql-sql.lisp,v 1.1 2002/09/30 10:19:23 kevin Exp $ +;;;; $Id: postgresql-sql.lisp,v 1.3 2003/07/21 01:45:45 kevin Exp $ ;;;; ;;;; This file, part of CLSQL, is Copyright (c) 2002 by Kevin M. Rosenberg ;;;; and Copyright (c) 1999-2001 by Pierre R. Mai @@ -18,15 +18,14 @@ ;;;; (http://opensource.franz.com/preamble.html), also known as the LLGPL. ;;;; ************************************************************************* -(declaim (optimize (debug 3) (speed 3) (safety 1) (compilation-speed 0))) -(in-package :cl-user) +(in-package #:cl-user) -(defpackage :clsql-postgresql - (:use :common-lisp :clsql-base-sys :postgresql :clsql-uffi) +(defpackage #:clsql-postgresql + (:use #:common-lisp #:clsql-base-sys #:postgresql #:clsql-uffi) (:export #:postgresql-database) (:documentation "This is the CLSQL interface to PostgreSQL.")) -(in-package :clsql-postgresql) +(in-package #:clsql-postgresql) ;;; Field conversion functions @@ -97,7 +96,17 @@ (destructuring-bind (host db user password &optional port options tty) connection-spec (declare (ignore password options tty)) - (concatenate 'string host (if port ":") (if port port) "/" db "/" user))) + (concatenate 'string + (etypecase host + (pathname (namestring host)) + (string host)) + (when port + (concatenate 'string + ":" + (etypecase port + (integer (write-to-string port)) + (string port)))) + "/" db "/" user))) (defmethod database-connect (connection-spec (database-type (eql :postgresql))) @@ -354,5 +363,4 @@ (lo-unlink (database-conn-ptr database) object-id)) (when (clsql-base-sys:database-type-library-loaded :postgresql) - (clsql-base-sys:initialize-database-type :database-type :postgresql) - (pushnew :postgresql cl:*features*)) + (clsql-base-sys:initialize-database-type :database-type :postgresql))