Hi, I''m seriously considering using Rails to develop several internal corporate web apps that will need to interact with well-established database systems (3 systems running SQL Server, Oracle, and PostgreSQL). The schema on these systems are basically set in stone. Can a Rails application interact with an existing schema without serious Rails modification? From what I''ve read about Rails, it expects the schema to have certain names, entries, and structure. Has someone developed with Rails in a similar situation? How did it go for you? Thanks, David -- Posted via http://www.ruby-forum.com/.
Yes. I am also building an internal app that interacts with an existing database system. It works fine. Check out http://wiki.rubyonrails.com/rails/pages/HowToUseLegacySchemas. There isn''t much you need to change in Rails, just more settings to point away from the default settings that''s all. David Mattes wrote:> Hi, > > I''m seriously considering using Rails to develop several internal > corporate web apps that will need to interact with well-established > database systems (3 systems running SQL Server, Oracle, and PostgreSQL). > The schema on these systems are basically set in stone. Can a Rails > application interact with an existing schema without serious Rails > modification? From what I''ve read about Rails, it expects the schema to > have certain names, entries, and structure. > > Has someone developed with Rails in a similar situation? How did it go > for you? > > Thanks, > David > >-- Sau Sheong http://blog.saush.com http://read.saush.com http://jaccal.sourceforge.net
Hi David, You should be able to use Rails without modifying the Rails code itself. Most likely you''ll need to do some extra configuration in your application''s models. This should help: http://api.rubyonrails.org/classes/ActiveRecord/Associations/ClassMethods.ht ml You would also probably use the set_table_name macro here: http://api.rubyonrails.org/classes/ActiveRecord/Base.html#M000880 Daniel -----Original Message----- From: rails-bounces@lists.rubyonrails.org [mailto:rails-bounces@lists.rubyonrails.org] On Behalf Of David Mattes Sent: Thursday, April 13, 2006 6:39 AM To: rails@lists.rubyonrails.org Subject: [Rails] Rails with existing RDBMS schema Hi, I''m seriously considering using Rails to develop several internal corporate web apps that will need to interact with well-established database systems (3 systems running SQL Server, Oracle, and PostgreSQL). The schema on these systems are basically set in stone. Can a Rails application interact with an existing schema without serious Rails modification? From what I''ve read about Rails, it expects the schema to have certain names, entries, and structure. Has someone developed with Rails in a similar situation? How did it go for you? Thanks, David -- Posted via http://www.ruby-forum.com/. _______________________________________________ Rails mailing list Rails@lists.rubyonrails.org http://lists.rubyonrails.org/mailman/listinfo/rails
David Mattes <david.mattes@...> writes:> I''m seriously considering using Rails to develop several internal > corporate web apps that will need to interact with well-established > database systems (3 systems running SQL ServerWorks fine, I am doing exact that as we speak, mostly with SQL-server. You can override the primary key name etc. Of course more you configure, more you lose the "convention over configuration" advantages of Rails.
> http://wiki.rubyonrails.com/rails/pages/HowToUseLegacySchemas. Therefrom what i can tell, this is great for a place that is soo stodgy they dont want to ever move to a new schema, or theres too much other legacy stuff relying on it.. is there an easy way to cast from one class to another? for example, i have a bunch of old data, and id like to make a OldThing and Thing class, they would be identical except OldThing would be decorated with all the custom SQL, and once the object is read, id like to write it out in the shiny new schema format... -- Posted via http://www.ruby-forum.com/.