[Rails] Re: PG gem behaves strange. It requires live DB connection to only generate a model. How to turn it
Wins Lin wrote in post #1107488:
> Hassan Schroeder wrote in post #1107485:
>> On Wed, May 1, 2013 at 8:09 AM, Wins Lin <lists@ruby-forum.com> wrote:
>
>> Not really. You can run MySQL locally and use PG on Heroku.
>
> I prefer to use raw sql anywhere where it not possible to use
> Model.find or Model.where. So it is quite a problem for me to separate
> server
> and local versions.
While there may be some circumstances where it may be necessary to wrote
raw SQL, doing so should be extremely rare. Arel (which the where method
derives) is a very powerful query language and AFAIK can do practically
anything that SQL can do. One major advantage of using Arel is that it
produced database agnostic queries.
I generally design my applications using SQLite in development, then
choose a production database based on my deployment needs. I make every
effort to create database agnostic code.
>> Maybe it's a Windows thing?
>
> Agree, maybe. They say all rake and rails tasks are so slow only on
> Windows. So it can be the reason.
>
>> Why would you start and stop it at all? If that's what you're using,
>> start it at boot time and forget about it.
>
> I have batch files that create a specific DB environments only when I
> run them. It is more convenient to me.
Sounds to me like you put great effort into making things less
convenient for yourself. Like developing Rails in Windows, using
database specific SQL embedded into your applications, etc.
> It is not a big problem with PG. It was a little unexpected after MySQL.
I find it extremely convenient using SQLite for development, on a UNIX
based OS, and having the flexibility of choosing whatever database I
want when it comes time to deploy my applications.
But, to each his own I suppose.
--
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 unsubscribe from this group and stop receiving emails from it, send an email to rubyonrails-talk+unsubscribe@googlegroups.com.
To post to this group, send email to rubyonrails-talk@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.
0 Comments:
Post a Comment
Subscribe to Post Comments [Atom]
<< Home