minor cleanup

db4
Doug Coleman 2008-02-12 17:19:55 -06:00
parent 092acdecc4
commit 13106c2227
2 changed files with 5 additions and 13 deletions

14
extra/db/postgresql/ffi/ffi.factor Normal file → Executable file
View File

@ -1,17 +1,14 @@
! Copyright (C) 2007 Doug Coleman.
! Copyright (C) 2007, 2008 Doug Coleman.
! See http://factorcode.org/license.txt for BSD license.
! tested on debian linux with postgresql 8.1
USING: alien alien.syntax combinators system ;
IN: db.postgresql.ffi
<<
"postgresql" {
<< "postgresql" {
{ [ win32? ] [ "libpq.dll" ] }
{ [ macosx? ] [ "/opt/local/lib/postgresql81/libpq.dylib" ] }
{ [ unix? ] [ "libpq.so" ] }
} cond "cdecl" add-library
>>
} cond "cdecl" add-library >>
! ConnSatusType
: CONNECTION_OK HEX: 0 ; inline
@ -75,7 +72,6 @@ TYPEDEF: void* SSL*
LIBRARY: postgresql
! Exported functions of libpq
! make a new client connection to the backend
@ -102,10 +98,6 @@ FUNCTION: PQconninfoOption* PQconndefaults ( ) ;
! free the data structure returned by PQconndefaults()
FUNCTION: void PQconninfoFree ( PQconninfoOption* connOptions ) ;
!
! close the current connection and restablish a new one with the same
! parameters
!
! Asynchronous (non-blocking)
FUNCTION: int PQresetStart ( PGconn* conn ) ;
FUNCTION: PostgresPollingStatusType PQresetPoll ( PGconn* conn ) ;

4
extra/db/postgresql/postgresql.factor Normal file → Executable file
View File

@ -39,8 +39,8 @@ M: postgresql-db dispose ( db -- )
M: postgresql-statement bind-statement* ( seq statement -- )
set-statement-params ;
M: postgresql-statement rebind-statement ( seq statement -- )
bind-statement* ;
M: postgresql-statement reset-statement ( statement -- )
drop ;
M: postgresql-result-set #rows ( result-set -- n )
result-set-handle PQntuples ;