A while ago I spent some (too much) time on a plugin that would add the required calls, but found the ODBC calling conventions extremely unfriendly and beyond what typical scripters would be willing to bear.
There are other solutions around that will help you with ODBC connectivity and many further related tasks, typically they are called catalog-something. Typical disadvantage is the price tag.
An alternative would be to write a bunch of JS wrapper classes, and invoke platform specific code via DoScript. If you're targeting Windows, Google for "ADO VBA".
Finally, you can also export to XML and use scripting on that.