On Oct 26, 2011, at 9:15 AM, pololo pololo wrote:

> Hi Walter,
> 
> Thanks a lot for your answer,
> Walter Davis wrote in post #1028584:
>> On Oct 26, 2011, at 6:45 AM, pololo pololo wrote:
>> 
>>> Hello world,
>>> 
>>> I'm new in this forum.
>>> 
>>> Is it possible to sqlite and mysql coexists in same RoR app?
>> 
>> Individual models can be mapped to entirely different databases (running
>> under different engines). More commonly, different applications are
>> mapped to different databases, and Rails as of 2.something supports
>> mounting one application inside another, so that could give you the kind
>> of isolation you're talking about here.
>> 
>>> I want to
>>> extend functionalities to an app making queries toa mysql server and I'm
>>> not sure if I can do it.
>> 
>> Are you saying you have a problem with MySQL on your server, or what?
>> 
>> Walter
> 
> I have an application for CRM using RoR, but now, i'd like to connect to 
> OrangeHRM (an opensource HR Management over LAMP),to send sql queries 
> against this mysql server.
> 
> My problem is not related about onnecting mysql; I mean, at 
> database.yml, can coexists a production for mysql and sqlite or sould I 
> try other approach?

I haven't needed to do it myself yet (actually working on something that will 
need this) but I have seen many tutorials on the Web related to connecting a 
single Rails application to multiple databases. It is just as simple as you 
say, make a production_1 and production_2 database connection, and use them 
through the base classes to set up the appropriate targets for your queries.

But what I suspect may be even easier here is for you to use something like 
Sinatra to create a very simple API endpoint wrapping around the legacy 
database, and then send requests through that API from your Rails application. 
It doesn't sound to me (you did mention SQL queries, after all) as if you 
actually need that other database to become an ActiveRecord model store.

Walter

> 
> Thanks a lot,
> 
> P
> 
> -- 
> Posted via http://www.ruby-forum.com/.
> 
> -- 
> You received this message because you are subscribed to the Google Groups 
> "Ruby on Rails: Talk" group.
> To post to this group, send email to rubyonrails-talk@googlegroups.com.
> To unsubscribe from this group, send email to 
> rubyonrails-talk+unsubscr...@googlegroups.com.
> For more options, visit this group at 
> http://groups.google.com/group/rubyonrails-talk?hl=en.
> 

-- 
You received this message because you are subscribed to the Google Groups "Ruby 
on Rails: Talk" group.
To post to this group, send email to rubyonrails-talk@googlegroups.com.
To unsubscribe from this group, send email to 
rubyonrails-talk+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-talk?hl=en.

Reply via email to