Friday, June 29, 2012

Re: advantages and disadvantages of Raw sql queries in django

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.11 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/

iQEcBAEBAgAGBQJP7qAhAAoJEGIoLYdRZJB1WjwH/R6i5YKfFEoWXDKavqEXdpXT
gCeVw1wxJayZ6arM9bfQpg1Ldxkl0E1xIwM5NNRfKl+mMFsH82BO/OvQJEcTcdsf
Jh3b4CMgFbzL4jmZgCy9nEjjNJu3BskAjVovWjAkpc8cu5GY18hjUuwQ19aJZx0y
OsXuUQjF//mYl2+TA73cjwI8Dndln00a7OktrYtuipWqCD/jeHkj+UtZH9pPtxKc
RSlcESX5aAQTq2w/TVF+ucEI0HG0yWj2yHxgLDWn3BIrzOoIkTOHOTYKwygAL1EQ
cP65hO97XyMH1BQQP3Pf48ySLJYKavcTwbEY8TKOk/IVM4Bd4ZyzHmfWg0NAB0I=
=jTG8
-----END PGP SIGNATURE-----
Also, using ORM means you're less likely to be tied to a specific
database...or in other words, your hand-crafted SQL is likely to be
specific to certain databases.

On 06/30/2012 08:33 AM, Mike Dewhirst wrote:
> I firmly believe in using the ORM for everything until i am forced to
> use handwritten SQL.
>
> The main reason is transparency of intentions when the source is
> examined by a non-DBA.
>
> I want my code to be maintainable by other people and provably correct.
> I suppose you can unit-test code with embedded SQL but it adds an extra
> layer of complexity.
>
> I could also argue against custom SQL because it contains business logic
> and i prefer to keep that all in one place, ie., in models in python code.
>
> So the bottom line for me is to avoid it where possible. Once
> everything is profiled and the last remaining bottlenecks are
> significant and cannot be removed unless I use custom SQL, that's when
> I'll do it.
>
> Haven't gotten there yet.
>
> -----Original message-----
>
> *From: *vijay shanker <vshanker.88@gmail.com>*
> To: *Django users <django-users@googlegroups.com>*
> Sent: *Sat, 30 Jun 2012, 14:35:54 AEST*
> Subject: *advantages and disadvantages of Raw sql queries in django
>
> 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.
>
> --
> 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.
>
> --
> 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