Thursday, May 19, 2011

Python Informix Database Connection Options

I am currently at the International Informix Users Group Conference (http://www.iiug.org/index.php) in Kansas. In the opening keynote by Jerry Keesee, there some discussion about IBM's Open Source Initiatives for Informix. On the accompanying slide, Python and Django were listed. This reminded me that I hadn't taken stock of what the Informix DB connections options were for the Python user lately. A quick "google" produced the following:

Python DB-API (http://www.python.org/dev/peps/pep-0249/) adaptors

  1. InformixDB http://informixdb.sourceforge.net/ The original DBAPI compliant database adaptor that wraps the Informix CliSDK. BSD License.
  2. ibm-db http://code.google.com/p/ibm-db/ IBM sponsored connector that provides Python, Django and SQLAlchemy support for IBM DB2 and Informix. Connects via the IBM DataServer component. Apache 2.0 License.
  3. mxODBC http://www.egenix.com/products/python/mxODBC/ Provides an interface to databases via an ODBC interface so supports Informix via Informix CLiSDK. Commerical License.

I have used both items 1 & 3 and they do work very well. Haven't used ibm-db as our sites normally only have CliSDK installed not IBM DataServer.

My preferred combination for Python Informix database access is using InformixDB in conjunction with SQLAlchemy.  SQLAlchemy allows me to choose how abstracted I want to be with my database, allowing direct SQL thru to utilizing an ORM.