[link|http://www.unixodbc.org/|unixODBC] appears to have a predictable API to access Data Sources
[link|http://www.unixodbc.org/drivers.html|unixODBC Drivers section] shows they even hacked thier own version to work. Even submitted the changes back to postgresql.
Funny thing about unixODBC... at GRCC I used it for a number of smaller project by a Department there. I set it up about 2 years ago. Even then I was amazed at how it worked. It could even connect to an Access DB! I found a piece somewhere that allowed me to do that... might have been a .so from Chilisoft though... but hey it DID work... and it seems to not break itself regularly either, as I never had to burp-it or any of the services that used it.