- sql Macro
- SQL-query Macro - performance optimized for read-only SQL statements - when supported by database/JDBC driver, so databases enforce read only behavior
Confluence 3.x wiki macros
Duplicate macros are available for Confluence 3.x style wiki markup for recursive use.
- sql1 - duplicate of sql for recursive use
- sql2 - duplicate of sql for recursive use
- sql3 - duplicate of sql for recursive use
- sql-query1 - duplicate of sql-query for recursive use
- sql-query2 - duplicate of sql-query for recursive use
- sql-query3 - duplicate of sql-query for recursive use
- SQL plugin datasource configuration and problem determination
Example chart from Site statistics
- This macro and the datasource parameter can be restricted to trusted users by configuring security using Macro Security for Confluence.
- The sql and sql-query macros are controlled separately. The duplicate macros (sql1, sql2, sql-query1, etc...) cannot be configured separately as they inherit from the macro they duplicate.
- Only some databases/JDBC drivers support read only connections to be established without restrictions on the database permission level. The sql-query macro uses this support to make it more convenient by only requiring a single datasource configuration. If you database/JDBC driver does not prevent updates when using the sql-query macro, then configure an additional datasource that only has read-only permission on your database. Use macro security at the datasource level to control access. For example, PostgreSQL supports this, but it is not supported on MS Sequel Server (SQL-52).
- On untrusted sites, prevent SQL injection attacks by using parameter markers. This in only necessary when the SQL statements are partially constructed from user input. See Wikipedia: SQL injection. Parameter markers are supported by the SQL plugin.
- Users requiring Anti-XSS support must upgrade to 4.1.0 or higher
- The disableAntiXss parameter on the sql and sql-query macros can be enabled by configuring security using Macro Security for Confluence.