#30242: Double spaces before limit/offset clause in as_sql() of SQLCompiler
               Reporter:  hangpark   |          Owner:  nobody
                   Type:             |         Status:  new
  Cleanup/optimization               |
              Component:  Database   |        Version:  master
  layer (models, ORM)                |       Keywords:  sql
               Severity:  Normal     |  databaseoperations sqlcompiler
           Triage Stage:             |      Has patch:  0
  Unreviewed                         |
    Needs documentation:  0          |    Needs tests:  0
Patch needs improvement:  0          |  Easy pickings:  1
                  UI/UX:  0          |
 `SQLCompiler` has `as_sql()` method to create the SQL for a given query.
 Specifically, end-users can get the SQL string of their `QuerySet` by this
 method like:


 where `User` is a basic user model.

 Absolutely, this returns a SQL string `SELECT "auth_user"."id" FROM
 "auth_user"`, and note that every separator between tokens is all single

 However, any query which has limit/offset clause produces double spaces
 before limit/offset clause. For example:


 SELECT "auth_user"."id" FROM "auth_user"  LIMIT 1 OFFSET 1
 SELECT "auth_user"."id" FROM "auth_user" LIMIT 1 OFFSET 1

 These queries are executed as well as expected but seem not a good
 practice for formatting SQL as a string.

Ticket URL: <https://code.djangoproject.com/ticket/30242>
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 unsubscribe from this group and stop receiving emails from it, send an email 
to django-updates+unsubscr...@googlegroups.com.
To post to this group, send email to django-updates@googlegroups.com.
To view this discussion on the web visit 
For more options, visit https://groups.google.com/d/optout.

Reply via email to