====== sql2wiki Plugin ====== ---- plugin ---- description: Save results of sqlite queries into page syntax author : Szymon Olewniczak email : it@rid.pl type : action, syntax lastupdate : 2023-08-03 compatible : Jack Jackrum, Igor depends : sqlite conflicts : similar : dbquery tags : sql, db, database, sqlite, pdo downloadurl: https://github.com/gkrid/dokuwiki-plugin-sql2wiki/archive/refs/heads/main.zip bugtracker : https://github.com/gkrid/dokuwiki-plugin-sql2wiki/issues sourcerepo : https://github.com/gkrid/dokuwiki-plugin-sql2wiki/ donationurl: screenshot_img : ---- ===== Usage ===== This plugin allows you to save the results of [[sqlite]] named queries into wiki syntax. Unlike other similar plugins, the results of queries are saved directly to the page source. Every change in the results of queries creates a new page revision. This might be useful when you need to track the changes in your results. To use the plugin you must first create a named query in [[sqlite]] plugin admin interface. Then you can refer to the query anywhere in the wiki using the following syntax: After saving the page another page edit will be performed by the plugin which will populate results. The result will be added to page content in CSV format between the '''' tag. In addition to refreshing the results after the page save, the plugin also tracks the changes in SQLite databases and updates the page source if needed. ===== Syntax ===== The '''' tag is parsed as an XML tag with the following arguments: * ''db'' - the sqlite database * ''query'' - the name of the named query * ''args'' - comma-separated list of arguments to the query. This can be useful when you want to use one query in different contexts on different pages. The args replace the quotation marks ''?'' placeholders defined in the query. The special variables: ''$ID$'', ''$NS$'' and ''$PAGE$'' can be used. * ''parser_N'' (requires [[struct]] plugin) - defines the struct value parser for the N-th column in the SQL result table. This can be the name of any type class that extends ''AbstractBaseType''. Additionally, you can specify the $config parameter for the type class. Examples: ''Wiki'', ''Page({"usetitles":true})'' ===== Discussion ===== [[https://github.com/gkrid/dokuwiki-plugin-sql2wiki/issues]]