I have written a socket-level interface to the PostgreSQL
object-relational DBMS for scsh. The module is capable of type
coercions from a range of SQL types to the equivalent Scheme type. The
module does not support crypt authentication (does anyone have a way
of accessing crypt() from scsh?), nor BLOBs.
Tested with scsh 0.5.1 on Debian Linux 1.3.1 and PostgreSQL 6.3.2
(it won't work with v6.4, since the socket-level protocol has
changed). Please send bug reports, suggestions and questions to
<emarsden@mail.dotcom.fr>. This is version 0.1, the first release.
The code is available under LGPL from
<URL:http://www.chez.com/emarsden/downloads/pgscsh-0.1.tar.gz>
Here is a taste of the API:
(define (demo)
(let* ((conn (pg:connect "template1" "postgres" "postgres"))
(res (pg:exec conn "SELECT * from scshdemo WHERE a = 42")))
(format #t "status is ~s~%" (pg:result res 'status))
(format #t "metadata is ~s~%" (pg:result res 'attributes))
(format #t "data is ~s~%" (pg:result res 'tuples))
(pg:disconnect conn)))
[PostgreSQL <URL:http://www.PostgreSQL.org/> is an open-source
database supporting most of the SQL92 standard, and object-relational
extensions such as user-defined types and functions.]
--
Eric Marsden
emarsden @ mail.dotcom.fr
It's elephants all the way down
|