;;;; Original code by Pierre R. Mai
;;;; Date Started: Feb 2002
;;;;
-;;;; $Id: postgresql-sql.cl,v 1.13 2002/04/19 20:25:20 marc.battyani Exp $
+;;;; $Id: postgresql-sql.cl,v 1.15 2002/04/27 20:58:11 kevin Exp $
;;;;
;;;; This file, part of CLSQL, is Copyright (c) 2002 by Kevin M. Rosenberg
;;;; and Copyright (c) 1999-2001 by Pierre R. Mai
((conn-ptr :accessor database-conn-ptr :initarg :conn-ptr
:type pgsql-conn-def)))
+(defmethod database-type ((database postgresql-database))
+ :postgresql)
+
(defmethod database-name-from-spec (connection-spec (database-type
(eql :postgresql)))
(check-connection-spec connection-spec database-type
(make-instance 'postgresql-database
:name (database-name-from-spec connection-spec
database-type)
+ :connection-spec connection-spec
:conn-ptr connection)))))
(setf length (lo-lseek ptr fd 0 2))
(lo-lseek ptr fd 0 0)
(when (> length 0)
- (setf buffer (uffi:allocate-foreign-string length :type '(:unsigned :byte)))
+ (setf buffer (uffi:allocate-foreign-string
+ length :unsigned t))
(when (= (lo-read ptr fd buffer length) length)
(setf result (uffi:convert-from-foreign-string
buffer :length length :null-terminated-p nil))))))