[[PageOutline(2-5,Contents,pullout)]] == SQL Table in Wiki Page == == Description == This is a simple macro that enables you to place tables resulting from SQL queries into a wiki page. It is similar to, but simpler than, SqlQueryMacro. The main differences are that it has fewer dependencies and always queries the Trac database, rather than letting you set up a separate data connection. == Usage == Use the SQLTable macro: {{{ #!sql {{{ #!SQLTable SELECT count(id) as "Number of Tickets" FROM ticket }}} }}} The result will be a table. You can also use wiki markup in the table: {{{ #!sql {{{ #!SQLTable SELECT '[milestone:' || name || ' ' || name || ']' as name, due, completed, description FROM milestone }}} }}} Use the SQLScalar macro: {{{ #!sql {{{ #!SQLScalar SELECT count(id) as "Number of Tickets" FROM ticket }}} }}} The result will be a single number. == Installation == 1. '''Install''' globally with: {{{ #!sh sudo easy_install https://trac-hacks.org/svn/wikitablemacro/0.11/ }}} 1. '''Enable''' the plugin by updating TracIni file (..../trac.ini) as follows: {{{ #!ini [components] wikitable.* = enabled }}} 1. '''Restart''' web server on command line: {{{ #!sh $ sudo /etc/init.d/apache2 restart }}} == Bugs/Feature Requests == Existing bugs and feature requests for !WikiTableMacro are [report:9?COMPONENT=WikiTableMacro here]. If you have any issues, create a [http://trac-hacks.org/newticket?component=WikiTableMacro&owner=rjollos new ticket]. == Source & Download == You can check out !WikiTableMacro from [http://trac-hacks.org/svn/wikitablemacro here] using Subversion, or [source:wikitablemacro browse the source] with Trac. Download the zipped source from [download:wikitablemacro here]. === Recent Changes === [[ChangeLog(wikitablemacro, 3)]] == Author/Contributors == '''Author:''' [wiki:optilude] [[BR]] '''Maintainer:''' [wiki:rjollos] [[BR]] '''Contributors:''' jun66j5