Previous: , Up: Octet Molding/Mashing   [Contents][Index]


10.4 Miscellaneous OMM

Here are some other procedures related to object molding/mashing.

Procedure: oid-type-name-cache conn [fresh?]

Query connection conn for oid/type-name info, caching results. Optional arg fresh? non-#f a (re-)query, updating the cache. Return a list of oid/type-name (number/string) pairs.

Recall that the pg-ftype example (see Processing Results) defines a procedure that returns the name of a PostgreSQL type by doing a query on the pg_type (internal) table. Here is a more efficient implementation:

(define CONN (pg-connectdb ...))

(define (pg-ftype-name result fnum)
  (assq-ref (oid-type-name-cache CONN)
            (pg-ftype result fnum)))