Importing existing Oracle DB to Ruby

We are moving ColdFusion applications to Ruby on Rails and we would
like to keep our existing data. Is there a way to import the Oracle
schema into Ruby using one of the commands?

Thanks!

What do you mean by ‘import into Ruby’? ActiveRecord (the database
library
of Rails) is capable of communicating with Oracle databases.

Jason

On 9/19/06, [email protected] [email protected] wrote:

We are moving ColdFusion applications to Ruby on Rails and we would
like to keep our existing data. Is there a way to import the Oracle
schema into Ruby using one of the commands?

Thanks!

I’m not sure what you’re asking. The schema isn’t “in” ruby. You can
access it without any change at all to the database if you like.
Might require some tweaking to your ActiveRecord models if the schema
is not using AR’s naming conventions (which would be a miracle if it
were.)

OR, you can port it to what ActiveRecord expects with its defaults,
which will make ongoing development quite a bit easier.


Imagination is more important than knowledge. – Albert Einstein

Hi !

2006/9/19, [email protected] [email protected]:

I suppose I’m looking for is a tutorial or a way to have a Ruby app
created based on an existing schema. I’m a newbie so I’m not sure if I
mean a scaffold. The examples I’ve found so far let me create new
databases which work fine. Sorry for the confusion.

Hmmm, I’d say that the scaffolding is what you want, to at least see
if you can access your existing data.

Start with a fresh Rails application. Setup config/database.yml
correctly. Then, use the console to confirm you can communicate with
the database:

$ script/console

ActiveRecord::Base.connection.execute(“SHOW TABLES”)

If you get an error, your connection parameters are incorrect.

Then, you can start building your scaffold:

$ script/generate scaffold User

Hope that helps !
François Beausoleil

Let me clarify,

I suppose I’m looking for is a tutorial or a way to have a Ruby app
created based on an existing schema. I’m a newbie so I’m not sure if I
mean a scaffold. The examples I’ve found so far let me create new
databases which work fine. Sorry for the confusion.

Thanks