parent
5c966a354e
commit
0505f630d3
|
@ -6,7 +6,7 @@ win32? [
|
||||||
! "postgresql" "dll" "stdcall" add-library
|
! "postgresql" "dll" "stdcall" add-library
|
||||||
] [
|
] [
|
||||||
"postgresql" "libpq.so" "cdecl" add-library
|
"postgresql" "libpq.so" "cdecl" add-library
|
||||||
] ifte
|
] if
|
||||||
|
|
||||||
[ "postgresql.factor" ]
|
[ "postgresql.factor" ]
|
||||||
[ "contrib/postgresql/" swap append run-file ] each
|
[ "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-drop-nofail ( PGconn query -- PGresult * )
|
||||||
[ do-query ]
|
[ do-query ]
|
||||||
|
catch
|
||||||
[
|
[
|
||||||
"non-fatal error, continuing" print
|
"non-fatal error, continuing" print
|
||||||
drop
|
drop
|
||||||
PQclear ! clear memory
|
PQclear ! clear memory
|
||||||
] catch ;
|
] when ;
|
||||||
|
|
||||||
! just a basic demo
|
! just a basic demo
|
||||||
: run-test ( -- )
|
: 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)
|
! 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* )
|
: 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
|
! close the current connection and free the PGconn data structure
|
||||||
FUNCTION: void PQfinish ( PGconn* conn ) ;
|
FUNCTION: void PQfinish ( PGconn* conn ) ;
|
||||||
|
|
Loading…
Reference in New Issue