Development

#5180 ([PATCH] Propel SQL logs are less readable)

You must first sign up to be able to contribute.

Ticket #5180 (new enhancement)

Opened 7 months ago

Last modified 3 months ago

[PATCH] Propel SQL logs are less readable

Reported by: francois Assigned to: Kris.Wallsmith
Priority: minor Milestone: 1.3.0
Component: sfPropelPlugin Version:
Keywords: Cc:
Qualification: Unreviewed

Description

In sf 1.0 and 1.1, SQL queries in the SQL panel of the web debug toolbar were syntax highlighted, and separated from each other by at least a blank line. Now they are all stacked together and not syntax highlighted anymore. It makes it very difficult to read the queries.

Also, Propel 1.3 uses PDO instead of Creole. That means logged SQL queries show named or question mark placeholder together with a replacement matrix.

SELECT COUNT(*) 
FROM sf_blog_comment 
WHERE (sf_blog_comment.SF_BLOG_POST_ID=:p1 
AND sf_blog_comment.IS_MODERATED=:p2) 
(:p1 = 1, :p2 = false)

I understand that this is what PDO can return, but that's a step back from what the Propel plugin used to do in sf 1.1. With Creole, the reals SQL queries appeared in the web debug toolbar, ready to be copied-and-pasted into a db engine to test the results.

SELECT COUNT(*) 
FROM sf_blog_comment 
WHERE (sf_blog_comment.SF_BLOG_POST_ID=1 
AND sf_blog_comment.IS_MODERATED=false)

To keep sf 1.2 on par with sf 1.1 as far as Propel debugging tools are concerned, the Propel Web Debug Panel should reconstruct an executable query from a prepared statement and a list of tokens.

Attachments

sfPropelPlugin.patch (3.0 kB) - added by francois on 04/01/09 11:57:10.
patch against the sfPropelPlugin

Change History

12/08/08 18:03:10 changed by francois

Also, a crucial information is missing in the Propel 1.3 logs: the time per request.

12/10/08 23:09:51 changed by FabianLange

  • owner changed from fabien to Kris.Wallsmith.
  • milestone set to 1.2.1.

12/10/08 23:10:00 changed by FabianLange

  • status changed from new to closed.
  • resolution set to fixed.

fixed in r13723

12/12/08 16:32:34 changed by francois

  • status changed from closed to reopened.
  • resolution deleted.

Three things are missing to close this ticket:

  • Increase the horizontal blank space between two queries to make them as readable as before
  • Re-add SQL syntax highlighting (as in the logs tab)
  • Re-add the time per query for each query

12/18/08 15:08:30 changed by Kris.Wallsmith

  • status changed from reopened to new.
  • summary changed from Propel SQL logs are less readable and can't be executed to Propel SQL logs are less readable.
  • type changed from defect to enhancement.
  • version deleted.
  • milestone changed from 1.2.1 to 1.3.0.

04/01/09 11:57:10 changed by francois

  • attachment sfPropelPlugin.patch added.

patch against the sfPropelPlugin

04/01/09 11:59:27 changed by francois

  • summary changed from Propel SQL logs are less readable to [PATCH] Propel SQL logs are less readable.

Proposed patch:

  • Does not remove Propel logs from the general logs anymore
  • Adds SQL syntax highlighting again
  • Adds a blank line between every query, to make them more readable

Left to do: Add back execution time for each query. The Propel team has done some work on logging lately, needs an update of the Propel 1.3 external.

04/01/09 12:05:49 changed by FabianLange

yep seen the updates on propel trac, but did not dare to update the external yet. the change looks quite big for me.

The Sensio Labs Network

Since 1998, Sensio Labs has been promoting the Open-Source software movement by providing quality web application development, training, consulting, and supporting several large Open-Source projects.