parent
5c966a354e
commit
0505f630d3
|
@ -6,7 +6,7 @@ win32? [
|
|||
! "postgresql" "dll" "stdcall" add-library
|
||||
] [
|
||||
"postgresql" "libpq.so" "cdecl" add-library
|
||||
] ifte
|
||||
] if
|
||||
|
||||
[ "postgresql.factor" ]
|
||||
[ "contrib/postgresql/" swap append run-file ] each
|
||||
|
|
|
@ -31,11 +31,12 @@ USING: kernel postgresql alien errors io ;
|
|||
|
||||
: do-query-drop-nofail ( PGconn query -- PGresult * )
|
||||
[ do-query ]
|
||||
catch
|
||||
[
|
||||
"non-fatal error, continuing" print
|
||||
drop
|
||||
PQclear ! clear memory
|
||||
] catch ;
|
||||
] when ;
|
||||
|
||||
! just a basic demo
|
||||
: run-test ( -- )
|
||||
|
|
|
@ -88,7 +88,7 @@ FUNCTION: PGconn* PQsetdbLogin ( char* pghost, char* pgport,
|
|||
! PQsetdbLogin(M_PGHOST, M_PGPORT, M_PGOPT, M_PGTTY, M_DBNAME, NULL, NULL)
|
||||
|
||||
: PQsetdb ( M_PGHOST M_PGPORT M_PGOPT M_PGTTY M_DBNAME -- PGconn* )
|
||||
NULL NULL PQsetdbLogin ;
|
||||
f f PQsetdbLogin ;
|
||||
|
||||
! close the current connection and free the PGconn data structure
|
||||
FUNCTION: void PQfinish ( PGconn* conn ) ;
|
||||
|
|
Loading…
Reference in New Issue