Extension:OdbcDatabase

The OdbcDatabase is intended for use with the Extension:External Data extension to add access to any data source via an ODBC driver. It has been developed on RHEL 5 using PHP 5.3.3 and MediaWiki 1.19.1 and has not been tested yet on any other platforms.

It is significant to note that this extension in NOT intended to supply sufficient capability to allow the primary MediaWiki database to be hosted though an ODBC connection using. This extensions provided limited functionality really only suitable to read-only uses, such as the External Data extension.

Download
''NOTE: I am still waiting for the repository for this extension to be created. As soon as it is, I will upload the code.''

Configuration parameters
This extension is not configured directly. Rather, it adds a new database type for use in other features or extensions that select the type of database to use, such as the External Data extension.

The database type supplied by this extension is "odbc". In External Data, one might use this in the following directive:

$edgDBServerType['mydatabase'] = "odbc";

User rights
No special User Rights used.

History and Context
The OdbcDatabase extension was created to solve a very specific, but possibly widely encountered, problem. We needed a way to pull data from a SQL Server 2005 database and display it on wiki pages, which are hosted on MediaWiki running on RHEL 5. In our case, the pages represented elements of our Enterprise Architecture, and the database contained basic attributes about each element, like name, Owner, Architect, description, etc. It was nice to be able to generate a wiki page for each element of our architecture, but we wanted a way to display those key characteristics from the source database when the page was visited without having to actually edit the page each time the data was updated in that database.

We found the External Data extension, which looked to be exactly what we needed. However, getting External Data to communicate with SQL Server proved challenging.

Working Solution
Our working solutions consists of the following software components, with the current version numbers we have running listed.

The stack of connections is as follows:
 * MediaWiki loads a page,
 * which invokes the External Data extension,
 * which uses the OdbcDatabase,
 * which uses odbc_* functions,
 * which use the unixODBC driver,
 * which is configured to use the FreeTDS driver,
 * which connects to SQL Server