# Support for IBM DB2 database in Radiant

**URL:** <https://www.ruby-forum.com/t/support-for-ibm-db2-database-in-radiant/92915>\
**Category:** Radiant CMS\
**Created:** [April 25, 2007, 5:39pm UTC](https://www.ruby-forum.com/t/support-for-ibm-db2-database-in-radiant/92915 "2007-04-25T17:39:31Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![unknown](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/u/4bbf92/32.png) [@unknown](https://www.ruby-forum.com/u/unknown)\
**Post date:** [April 25, 2007, 5:39pm UTC](https://www.ruby-forum.com/t/support-for-ibm-db2-database-in-radiant/92915/1 "2007-04-25T17:39:31Z")

</div>

I would be interested in building a Radiant site with the IBM DB2 9.1  
database as a back end.  
Such product is available in a free express edition, and provides native  
XML data storage, which would be very useful for our site, devoted to  
XBRL, a language derived from XML used for representing financial  
documents ([http://xbrl.org](http://xbrl.org)).

I have installed the IBM\_DB adapter version 0.4.6 and had it running.  
The  
adapter is still limited, since it does not support rename\_column.  
I was able to create the radiant bootstrap database substituting the  
final  
DB schema for the sequence of migrations.  
I can create smippets and layouts, but cannot create pages. After  
posting  
the “create” command, I get an error message of the sort (translated  
from  
Italian):

Found unforeseen token “)” after “UPDATE pages SET (”. Token may be:  
“\<update\_target\_list\>”. SQLSTATE=42601  
SQLCODE=-104’

Before wasting too much time, I would like to know if someone in the  
Radiant community has considered supporting DB2.  
In order to support it, what should be needed? Is a compliant ruby db  
adapter enough, or you have to tweak specific SQL statements somewhere  
in  
radiant code?

Thanks in advance

Luca

Luca Erzegovesi

University of Trento, Italy  
removed\_email\_address@domain.invalid

---

<div class="post-metadata">

**Author:** ![unknown](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/u/4bbf92/32.png) [@unknown](https://www.ruby-forum.com/u/unknown)\
**Post date:** [April 25, 2007, 5:48pm UTC](https://www.ruby-forum.com/t/support-for-ibm-db2-database-in-radiant/92915/2 "2007-04-25T17:48:32Z")

</div>

On Wed, 25 Apr 2007, removed\_email\_address@domain.invalid wrote:

> Before wasting too much time, I would like to know if someone in the  
> Radiant community has considered supporting DB2.  
> In order to support it, what should be needed? Is a compliant ruby db  
> adapter enough, or you have to tweak specific SQL statements somewhere in  
> radiant code?

Luca,

Radiant uses the Rails framework, which is where all the database  
adapters  
live… and it seems there are already three projects that are in  
process  
or already working.

[http://wiki.rubyonrails.com/rails/pages/IBM+DB2](http://wiki.rubyonrails.com/rails/pages/IBM+DB2)

But it seems Radiant does have specific code to deal with different DB  
engines. DB2 is on the list of engines to support, but no one is testing  
it yet… except you!

[http://radiantcms.org/blog/2006/05/09/improved-database-support/](http://radiantcms.org/blog/2006/05/09/improved-database-support/)

I would think your testing will help this effort along.

Chris

---

<div class="post-metadata">

**Author:** ![unknown](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/u/4bbf92/32.png) [@unknown](https://www.ruby-forum.com/u/unknown)\
**Post date:** [April 25, 2007, 5:57pm UTC](https://www.ruby-forum.com/t/support-for-ibm-db2-database-in-radiant/92915/3 "2007-04-25T17:57:32Z")

</div>

Radiant uses Rails’ database adapters with very little modification (I  
think there was a sqlite patch in there somewhere). Traditionally,  
Rails has not supported DB2 well. Anything you could contribute to  
improve the adapter would be appreciated in the Rails community at  
large, I imagine.

Sean

---

<div class="post-metadata">

**Author:** ![unknown](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/u/4bbf92/32.png) [@unknown](https://www.ruby-forum.com/u/unknown)\
**Post date:** [April 25, 2007, 6:00pm UTC](https://www.ruby-forum.com/t/support-for-ibm-db2-database-in-radiant/92915/4 "2007-04-25T18:00:32Z")

</div>

removed\_email\_address@domain.invalid wrote:

> Before wasting too much time, I would like to know if someone in the  
> Radiant community has considered supporting DB2.  
> In order to support it, what should be needed? Is a compliant ruby db  
> adapter enough, or you have to tweak specific SQL statements somewhere in  
> radiant code?

I’m happy to apply any patches to Radiant that allow it to support other  
databases, but Radiant mostly relies on Rails to write the SQL. Getting  
Radiant to run on another database has been relatively straightforward.  
Databases occasionally seem to have problems with one of the  
ArchiveIndexPages, but that is mostly a matter of updating the way  
Radiant extracts date parts (month, day, year) from a date field.

I’d suggest that you do the following:

1. Get Radiant’s test suite to pass on DB2

2. Get migrations running on DB2

3. Contribute changes to the DB2 database adapter back to Rails (if you  
have any)

4. Send me a patch for Radiant (if it turns out that it needs one)

–  
John L.  
[http://wiseheartdesign.com](http://wiseheartdesign.com)
