WikiDB

From TestWiki
Revision as of 23:13, 23 February 2011 by HappyDog (Talk | contribs) (Documentation: + index)

Jump to: navigation, search
WikiDB icon.png

WikiDB is a MediaWiki extension which can be used to add database functionality to your wiki. Its core principal is to do this whilst still following a wiki-like workflow for creating and managing data. Data is therefore defined in-page via the standard editing process and, just as you can create links to pages that don't exist, you can put data into a table that doesn't exist, and you are able to display and query that data without requiring any formal structure to be defined.

By creating a table definition, however, you get to force fields to a certain data-type, define fields as aliases of each other (e.g. if different articles use a different name to refer to the same field) and easily flag up unexpected fields that may have been added in error. Changing the field definition instantly updates all data output on the wiki, however the original data is left unmodified. This means that schema changes will never result in data being lost or corrupted.

Because WikiDB allows you to define data on any page, the data can be located directly within the article it relates to. It is therefore easy to find, and there is no problem ensuring it stays up-to-date as the article changes. By default, WikiDB hides the raw data at the point that it is defined, on the assumption that you will output it in aggregated form elsewhere. However you also have the option of outputting it in a standard tabular form or to pass the fields as parameters to a template for in-line display (so if your wiki makes extensive use of infoboxes, it will be easy to update it so this data goes into a table as well).

For more information, see the documentation, below.

News

Version 3 is now available

This is the first update to WikiDB for about a year and a half, partly due to a very busy life, and partly due to this being quite a major reworking of some of the core internals. This new version includes the following new features:

  • Proper alias resolution (you can now rename tables and watch as the data magically follows the redirect).
  • An extension of the <data> tag which allows you to define multiple data rows within a single tag.
  • Fixes to the sorting/filtering algorithm so that the <repeat> tag now works a lot better (and hopefully a lot faster!).
  • Updated the way parsing works when saving a page. It is now a lot less hacky and less likely to break if the MW parser object is updated. It also now ensures the article is parsed consistently in all cases (previously it was done differently when saving to when viewing the page, which in some rare cases could result in a mismatch between the data you see and what is actually in the DB).
  • A number of display bugs are now fixed, particularly in relation to the way the SourceArticle field was output.
  • Much less chance of SQL injection.
  • We now have maintenance scripts! No more copy/paste SQL! No more null edits to fix parsing issues!
  • A whole load of other little bug fixes, and a general code cleanup.
  • No doubt some other little bits I've forgotten.

The documentation on this wiki has not yet been updated (apart from the installation instructions), but I am working on it... In the meantime, you're advised to check the last edit date of any information, before treating it as gospel! :-)

-- 00:30, 12 September 2010 (BST)

<repeat> syntax

I am holding a consultation about the syntax of the repeat tag, as the more I think about it the more I realise that there is probably not a 'perfect' solution, but instead a 'best compromise' between simplicity, brevity, flexibility and readability. Anyone who would like to input on this should do so on the Repeat tag syntax page. --HappyDog 23:50, 9 December 2008 (GMT)

Documentation

MediaWiki logo.png
This extension is also documented at
Extension:WikiDB
on MediaWiki.org.

If the pages are not in sync. then this version on my test wiki is always the most up-to-date.


Technical Info

  • Tables - Details about the new tables that are required by the extension.
  • Files - Listings of all the files required by the extension.