= Execute an SQL Query = [[TOC]] == Description == Execute an SQL Query against a configured database displaying a formatted table of results. See als WikiTableMacro for 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 [http://trac-hacks.org/newticket?component=SqlQueryMacro&owner=JamesMills new ticket]. == Download == Download the zipped source from [download:sqlquerymacro here]. == Source == You can check out SqlQueryMacro from [http://trac-hacks.org/svn/sqlquerymacro here] using Subversion, or [source:sqlquerymacro browse the source] with Trac. == Example == This macro can be used in one of two ways: {{{ {{{ #!SQL SELECT * FROM foo }}} }}} or {{{ [[SQL(SELECT * FROm foo)]] }}} == Install == This macro requires the [http://trac.shortcircuit.net.au/ pymills] library and makes use of it's '''db''' and '''table''' modules. Please install pymills first. {{{ easy_install pymills }}} To install the macro: {{{ easy_install TracSqlQueryMacro }}} To enable: {{{ #!ini [components] sqlquery.* = enabled }}} == Configure == To configure this plugin, you must tell sqlquery what database to connect to: In {{{trac.ini}}} (''or via the Web Admin''): {{{ [sqlquery] uri = mysql://user:password@hostname/database }}} You can also use oracle or sqlite: {{{ uri = oracle://user:password@tns:/ or uri = sqlite:///path/to/db }}} == Feedback == Please give your feedback (''anything that shouldn't be a ticket'') [wiki:SqlQueryMacro/Feedback here] == Recent Changes == [[ChangeLog(sqlquerymacro, 3)]] == Author/Contributors == '''Author:''' [wiki:JamesMills] [[BR]] '''Contributors:'''