Saturday, June 30, 2012

Re: advantages and disadvantages of Raw sql queries in django

On 30/06/2012 07:36 πμ, vijay shanker wrote:
> hi
> i want to know pros and cons associated with running raw sql queries
> over django's ORM .
> googled it out but couldn find many useful links.
>
>
At some point in the future you may find yourself in a position when you
will need to change the underlying DB engine.
In these cases ORM is a life saver.

This scenario is not far-fetched it is very common actually. I use
sqlite to develop my app, but in the production server I use mysql.
The code is the same, I have to change only 2 lines in settings.py
This makes development very easy and very portable.
I can reproduce my development environment in 10mins (with the use of
pip and virtualenv of course) and start working in a new machine with
minimum hassle.

--
--------------------------------------------------------------
Nick Apostolakis
e-mail: nickapos@oncrete.gr
Web Site: http://nick.oncrete.gr
--------------------------------------------------------------


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

No comments:

Post a Comment