Rails with DB2 and multiple schemas

Posted by GNUMatrix on Stack Overflow See other posts from Stack Overflow or by GNUMatrix
Published on 2010-04-06T05:37:55Z Indexed on 2010/04/06 5:43 UTC
Read the original article Hit count: 257

Filed under:
|
|
|

I have a 'legacy' DB2 database that has many other applications and users. Trying to experiment with a rails app. Got everything working great with the ibm_db driver.

Problem is that I have some tables like schema1.products, schema1.sales and other tables like schema2.employees and schema2.payroll.

In the ibm_db adapter connection, I specify a schema, like schema1 or schema2, and I can work within that one schema, but I need to be able to easily (and transparently) reference both schemas basically interchangeably. I don't want to break the other apps, and the SQL I would normally write against DB2 doesn't have any of these restrictions (schemas can be mixed in SQL against DB2 without any trouble at all).

I would like to just specify table names as "schema1.products" for example and be done with it, but that doesn't seem to jive with the "rails way" of going about it.

Suggestions?

© Stack Overflow or respective owner

Related posts about db2

Related posts about rails