Changes between Version 29 and Version 30 of WikiTableMacro


Ignore:
Timestamp:
Sep 22, 2016, 10:56:10 PM (7 years ago)
Author:
figaro
Comment:

Moved example to functional description

Legend:

Unmodified
Added
Removed
Modified
  • WikiTableMacro

    v29 v30  
    55== Description
    66
    7 This is a macro that enables you to place tables resulting from SQL queries into a Trac wiki page. For usage examples, see below.
     7This is a macro that enables you to place tables resulting from SQL queries into a Trac wiki page.
     8
     9Use the '''SQLTable''' macro as follows:
     10
     11{{{
     12{{{#!SQLTable
     13SELECT COUNT(id) AS "Number of Tickets"
     14FROM ticket
     15}}}
     16}}}
     17
     18The result will be a table displayed in a html page.
     19
     20You can also use wiki markup in the table:
     21
     22{{{
     23{{{#!SQLTable
     24SELECT '[milestone:' || name || ' ' || name || ']' AS name, due, completed, description
     25FROM milestone
     26}}}
     27}}}
     28
     29Use the '''SQLScalar''' macro:
     30
     31{{{
     32{{{#!SQLScalar
     33SELECT COUNT(id) AS "Number of Tickets"
     34FROM ticket
     35}}}
     36}}}
     37
     38The result will be a single number.
    839
    940It is similar to, but simpler than, SqlQueryMacro or SqlAlchemyQueryMacro. The main differences are that it has fewer dependencies and only queries the Trac database, rather than requiring you to set up a separate database connection.
     
    1142== Bugs/Feature Requests
    1243
    13 Existing bugs and feature requests for !WikiTableMacro are [report:9?COMPONENT=WikiTableMacro here].
     44Existing bugs and feature requests for !WikiTableMacro are
     45[report:9?COMPONENT=WikiTableMacro here].
    1446
    15 If you have any issues, create a [/newticket?component=WikiTableMacro new ticket].
     47If you have any issues, create a
     48[/newticket?component=WikiTableMacro new ticket].
    1649
    1750[[TicketQuery(component=WikiTableMacro&group=type,format=progress)]]
     
    4174}}}
    4275
    43 == Usage
    44 
    45 Use the SQLTable macro as follows:
    46 
    47 {{{
    48 {{{#!SQLTable
    49 SELECT count(id) as "Number of Tickets"
    50 FROM ticket
    51 }}}
    52 }}}
    53 
    54 The result will be a table displayed in a html page.
    55 
    56 You can also use wiki markup in the table:
    57 
    58 {{{
    59 {{{#!SQLTable
    60 SELECT '[milestone:' || name || ' ' || name || ']' as name, due, completed, description
    61 FROM milestone
    62 }}}
    63 }}}
    64 
    65 Use the SQLScalar macro:
    66 
    67 {{{
    68 {{{#!SQLScalar
    69 SELECT count(id) as "Number of Tickets"
    70 FROM ticket
    71 }}}
    72 }}}
    73 
    74 The result will be a single number.
    75 
    7676== Recent Changes
    7777