[[PageOutline(2-5,Contents,pullout)]] = Execute an SQL Query from within Trac == Description This plugin allows you to execute an SQL Query against a configured database displaying a formatted table of results from within Trac. This macro can be used in one of two ways: {{{ {{{#!SQL SELECT * FROM component }}} }}} or: {{{ [[SQL(SELECT * FROM component)]] }}} See also: * SqlAlchemyQueryMacro: a plugin that supersedes !SqlQuery. * WikiTableMacro: a simpler implementation, which does not allow to define a datasource. == Bugs/Feature Requests Existing bugs and feature requests for SqlQueryMacro are [report:9?COMPONENT=SqlQueryMacro here]. If you have any issues, create a [/newticket?component=SqlQueryMacro new ticket]. == Download Download the zipped source from [export:sqlquerymacro here]. == Source You can check out SqlQueryMacro from [/svn/sqlquerymacro here] using Subversion, or [source:sqlquerymacro browse the source] with Trac. == Installation To install the macro: {{{#!sh $ pip install svn+https://trac-hacks.org/svn/sqlquerymacro/1.0 }}} or {{{#!sh $ pip install svn+https://trac-hacks.org/svn/sqlquerymacro/0.11 }}} To enable in your `trac.ini` file: {{{#!ini [components] sqlquery.* = enabled }}} == Configuration Configuration is only needed if using a datasource other than Trac's database. To configure this plugin, you must tell SQLQuery what database to connect to. In `trac.ini`: {{{#!ini [sqlquery] uri = sqlite:///path/to/db }}} The allowed [TracEnvironment#DatabaseConnectionStrings database connection strings] are those supported by Trac. == Recent Changes [[ChangeLog(sqlquerymacro, 3)]] == Author/Contributors '''Author:''' JamesMills [[BR]] '''Maintainer:''' [[Maintainer]] [[BR]] '''Contributors:'''