DokuWiki

It's better when it's simple

User Tools

Site Tools


plugin:dbquery

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Next revision
Previous revision
plugin:dbquery [2021-01-19 10:58] – created andiplugin:dbquery [2023-07-10 23:50] (current) – version upped andi
Line 6: Line 6:
 email      : dokuwiki@cosmocode.de email      : dokuwiki@cosmocode.de
 type       : helper, syntax type       : helper, syntax
-lastupdate : 2021-01-19 +lastupdate : 2023-07-10 
-compatible : hogfather+compatible : Hogfather
 depends    :  depends    : 
 conflicts  conflicts 
 similar    : sql, sqlcomp similar    : sql, sqlcomp
-tags       : sql, db, database+tags       : sql, db, database, mysql, postgres, sqlite, pdo
  
 downloadurl: https://github.com/cosmocode/dokuwiki-plugin-dbquery/zipball/master downloadurl: https://github.com/cosmocode/dokuwiki-plugin-dbquery/zipball/master
Line 21: Line 21:
 ---- ----
  
-This plugin allows you display the results of a database query either as a table or a HTML formatted status. Unlike other, similar plugins this plugins strictly separated the definition of the queries to run from the part where they are used. This allows to use ACL rules to prevent users from running arbitrary queries on the connected database.+[[https://www.cosmocode.de/en/open-source/dokuwiki-plugins/|{{ http://cosmocode.de/static/img/dokuwiki/dwplugins.png?recache|A CosmoCode Plugin}}]] 
 + 
 +This plugin allows you display the results of a database query either as a table or a HTML formatted status. Unlike other, similar plugins this plugins strictly separates the definition of the queries to run from the part where they are used. This allows to use ACL rules to prevent users from running arbitrary queries on the connected database.
  
 The connection to the database is done via PDO, the plugin itself is database agnostic. The connection to the database is done via PDO, the plugin itself is database agnostic.
Line 106: Line 108:
 </code> </code>
 </file> </file>
 +
 +
 +==== Macros ====
 +
 +Additional macros can be added to the query page to influence how the query is executed or the result is displayed. Currently the following macros are supported:
 +
 +  * ''~~DBQUERY:transpose~~'' When the query result is shown as a table, the table is transposed with column headers to the left and rows shown as columns. This should only be done for very short result sets and many queried columns. Eg. where there are more columns than rows in the result.
  
  
Line 163: Line 172:
  
  
 +Note: the plugin will autodetect DokuWiki link syntax in the result contents and appropriately create links when showing tabular results. However there are a few caveats:
  
 +  * The link syntax has to be the only cell content, eg. it starts and ends with ''%%[[%%'' and ''%%]]%%'' respectively.
 +  * Only ''%%http://%%'', ''%%https://%%'' and internal links are recognized
 +  * This feature does not the full wiki parser to parse contents, so no other syntax is recognized and handled specially
  
  
  
plugin/dbquery.1611050336.txt.gz · Last modified: 2021-01-19 10:58 by andi

Except where otherwise noted, content on this wiki is licensed under the following license: CC Attribution-Share Alike 4.0 International
CC Attribution-Share Alike 4.0 International Donate Powered by PHP Valid HTML5 Valid CSS Driven by DokuWiki