DokuWiki

It's better when it's simple

User Tools

Site Tools


plugin:sql2wiki

sql2wiki Plugin

Compatible with DokuWiki

  • 2024-02-06 "Kaos" unknown
  • 2023-04-04 "Jack Jackrum" yes
  • 2022-07-31 "Igor" yes
  • 2020-07-29 "Hogfather" unknown

plugin Save results of sqlite queries into page syntax

Last updated on
2023-08-03
Provides
Syntax, Action
Repository
Source
Requires
sqlite

Similar to dbquery

Tagged with database, db, pdo, sql, sqlite

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:

<sql2wiki db="db_name" query="name of the query"></sql2wiki>

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 <sql2wiki></sql2wiki> 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

<sql2wiki db="..." query="..." args="..." parser_0="..." parser_1="..."></sql2wiki>

The <sql2wiki> 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

plugin/sql2wiki.txt · Last modified: 2023-08-03 13:17 by solewniczak

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