Is it possible to convert TracQuery to a Trac SQL statement and vice versa?

I created several TracReports, but trying to do this using SQL, I do not get the expected result. This was my SQL query:

SELECT      p.value AS __color__,
            reporter AS __group__,
            id AS ticket, summary, resolution , component, 
            t.type AS type, priority, severity, time AS created,
            changetime AS modified,
            changetime AS __changetime, description AS _description,
            reporter AS _reporter
FROM        ticket t
LEFT JOIN   enum p ON p.name = t.priority AND p.type = 'priority'
WHERE       t.status = 'closed'
ORDER BY    changetime DESC, CAST(p.value AS integer), milestone, t.type, time

Using this query, the reporter group does not work at all. I get a few lines for each reporter. So I tried to get the result using the "Custom Request" function. This triggered my expected result with the following TracQuery:

query:?status=closed
&group=reporter
&col=id
&col=summary
&col=resolution
&col=component
&col=type
&col=priority
&col=severity
&col=time
&col=changetime
&order=changetime
&desc=1

My question is: can I convert TracQuery to an SQL statement or can I see the SQL statements that execute in the backend? I ask because I want to be able to use some of the columns or use other SQL functions.

+3
source share
2

DEBUG [trac] debug_sql = true trac.ini. SQL, , , . - .

, , , , , Trac .

+4

Trac SQL , ( ). SQL, , Trac - - SQL- TracQuery.

Trac "DEBUG" , - .

+1

Source: https://habr.com/ru/post/1780464/


All Articles