[Bigloo-lib-devel] patch for postgresql rdbms
Status: Beta
Brought to you by:
wowa
|
From: Todd D. <td...@au...> - 2002-05-02 03:29:11
|
I had to do the following to get the regression to look like it worked right for me. I couldn't get the database to connect using the old PQsetdbLogin. It also couldn't reliably tell whether the server was running or not. I started with a conn-status method, but then I noticed how it was done in mysql.defs and copied that style. Is this project still actively being developed? thanks, Todd. diff -b pgsql.defs ../../bigloo-lib-0.17/rdbms/pgsql.defs 91,106c91,103 < (let* ((parameter-string::string < (string-append (if dbname (string-append "dbname=" dbname ) "") < (if username (string-append "username=" username) "") < (if password (string-append "password=" password) "") < (if hostname (string-append "hostname=" hostname) "") < (if pgport (string-append "pgport=" pgport) "") < (if pgoptions (string-append "options=" pgoptions) ""))) < (conn (instantiate::pgsql-connection < (impl (pragma::pgsql-conn "PQconnectdb ($1)" parameter-string))))) < (with-access::pgsql-connection < conn (impl) < (if (not (eq? 'ok (pgsql-conn-status impl))) < (error "pgsql-connect" < "Cannot connect to database" < dbname) < conn)))) --- > (let* ( > (user::string (or username "postgres")) > (pass::string (or password "")) > (db::string (or dbname "postgres")) > (host::string (or hostname "localhost")) > (port::string (or pgport "5432")) > (opt::string (or pgoptions "")) > ) > (instantiate::pgsql-connection > (impl > (pragma::pgsql-conn "PQsetdbLogin($1, $2, $3, NULL, $4, $5, $6)" > host port opt db user pass))) > )) 356,357c353,354 < (define (pgsql-conn-status::pgsql-conn-status-type self::pgsql-conn) < (pragma::pgsql-conn-status-type "PQstatus($1)" self)) --- > (define (pgsql-error::string self::pgsql-conn) > (pragma::string "PQerrorMessage($1)" self)) 378a376 > |