#16427: truncate table method in ORM
-------------------------------------+-------------------------------------
               Reporter:             |          Owner:  nobody
  adamnelson                         |         Status:  new
                   Type:  New        |      Component:  Database layer
  feature                            |  (models, ORM)
              Milestone:             |       Severity:  Normal
                Version:  1.3        |       Keywords:
             Resolution:             |      Has patch:  0
           Triage Stage:  Design     |    Needs tests:  0
  decision needed                    |  Easy pickings:  0
    Needs documentation:  0          |
Patch needs improvement:  0          |
                  UI/UX:  0          |
-------------------------------------+-------------------------------------
Changes (by aaugustin):

 * needs_docs:   => 0
 * stage:  Unreviewed => Design decision needed
 * needs_tests:   => 0
 * needs_better_patch:   => 0


Comment:

 As far as I can tell, `TRUNCATE` is not part of SQL-92, and it isn't
 implemented by sqlite, so it isn't a good candidate for ORM support.

 What's wrong with `MyModel.objects.delete()`? At least sqlite will
 optimize this by performing a truncate. I don't know very well the
 internal of other database engines, but they may optimize it too.

 Finally, you can use raw SQL.

 I'm leaning towards "wontfix", but let's wait for a core developer's
 opinion,

-- 
Ticket URL: <https://code.djangoproject.com/ticket/16427#comment:1>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.

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

Reply via email to