Hi, folks
I'm trying to build a PostgreSQL interface to Guile/scheme
(with much help from others), the PostgreSQL part of squile
(see http://www.forcix.cx/squile.html).
Obe of the things squile tries is to transform the database
types into native language types.
For PostgreSQL this would imply looking things up in the
pg_types table and figuring out what to do.
I've had a peek into two of the interfaces which try to do
a type mapping: jdbc and odbc. My impression is:
- odbc tries to do a static mapping, ignoring whatever is in the pg_types Right?
- jdbc looks the type name (via the oid, as given by PQftype()) and decides based on that. The result is cached (which
tome looks a bit problematic, since the contents of the table could change at run time, but I may be too pedantic here
;)
It would be interesting to write up a type mapper which could be
of some more general utility (no idea whether this would be
feasible at all). I'd be willing to give it a try.
I'm sure this has been discussed at length elsewhere -- but I
didn't manage to find anything searching this list's archives.
I would appreciate any pointers in this directions.
Thanks a lot
-- tomas