Difference between revisions of "WikiDB"

From TestWiki
Jump to: navigation, search
(News: Update)
(News: Release of 5.1.2)
(42 intermediate revisions by the same user not shown)
Line 1: Line 1:
 +
{{ExtensionCheck}}
 
[[Image:WikiDB icon.png|right]]
 
[[Image:WikiDB icon.png|right]]
This extension implements a wiki-style database within your wiki.  You can define tables, enter data and run queries using wiki markup, and all of these things are independent of each other.
+
'''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.
  
Three things to bear in mind before going any further:
+
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.
  
# This is in an early stage of developmentCore functionality is in place, but many planned features are currently lacking.
+
Because '''WikiDB''' allows you to define data on any page, the data can be located directly within the article it relates toIt is therefore easy to find, and there is no problem ensuring it stays up-to-date as the article changesBy 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).
# The syntax is currently fairly long-winded for certain tasksThis will be streamlined (suggestions welcome) but it is sufficient for proof-of-concept.
+
 
# There has been very little optimisation, and there is a lot of potential for it.  I welcome advice on this matter, but do not be put off by speed/efficiency of the current version.
+
For more information, see the [[#Documentation|documentation]], below.
  
 
== News ==
 
== News ==
  
=== Version 3 is now available ===
+
<span style="font-size: 1.2em;">'''[[Media:WikiDB.zip|Download WikiDB Here!]]'''<br>
* '''[[:Image:WikiDB.zip|Click here to download (zip file)]]'''
+
<span style="font-size: 0.8em;">[[/Installation/|Installation instructions]] &bull; [[/CHANGELOG/|CHANGELOG]] &bull; [[:Image:WikiDB.zip|Older versions]]</span>
* '''[[/Installation/|Installation instructions]]'''
+
  
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:
+
=== v5.1.2 released ===
  
** Proper alias resolution (you can now rename tables and watch as the data magically follows the redirect).
+
This new release resolves a few issues relating to MediaWiki 1.38, as well as fixing an issue with the parsing of query criteria.
** An extension of the &lt;data&gt; tag which allows you to define multiple data rows within a single tag.
+
** Fixes to the sorting/filtering algorithm so that the &lt;repeat&gt; 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/|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! :-)
+
-- [[User:HappyDog|HappyDog]] ([[User talk:HappyDog|talk]]) 23:08, 2 August 2022 (BST)
  
-- 00:30, 12 September 2010 (BST)
+
=== v5.1.1 released ===
  
=== &lt;repeat&gt; syntax ===
+
This is a bug-fix release to resolve a fatal error on MediaWiki 1.37.
  
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. --[[User:HappyDog|HappyDog]] 23:50, 9 December 2008 (GMT)
+
-- [[User:HappyDog|HappyDog]] ([[User talk:HappyDog|talk]]) 18:54, 11 March 2022 (GMT)
  
== Documentation ==
+
=== v5.1.0 released ===
{{On MediaWiki.org}}
+
* '''[[/Tutorial/]] - read this first!'''
+
* [[/Features/]] - A list of the extension's current and planned functionality.
+
* [[/Data types/]] - A list of currently supported data types.
+
* [[/Installation/]] - What you need to do to get the extension working.
+
* [[/Syntax/]] - Current syntax for all elements of the extension.
+
* [[/ToDo/|ToDo List]] - My list of planned features, and general (non-bug) issues that need fixing.
+
* [[/Bugs/|Bugs]] - Please report any bugs here.
+
* [[/Feature requests/]] - Add any suggestions for new features to this page.
+
* [[/License/|License]] - CC-BY-SA 2.5
+
<br clear="right">
+
  
== Requirements ==
+
As well as fixing a number of breakages introduced by MediaWiki 1.37, this release has a cool new feature: Multi-value fields.
  
Currently this extension ''probably'' just requires MW 1.4.0 and above, but that is very much untestedIn practice I was developing on 1.5.8 initially, and now on 1.6.10 - so it probably works fine on 1.5.x and 1.6.x (though this may change).  It should also be fine on later versions of MW, but this has not been tested by me.
+
Multi-value fields provide a simple way of implementing what would normally be called many-to-many relationships to reference dataFor example, if a Student may be in multiple Courses, you can now specify more than one value for the Course column when defining data to go into the Student table.
  
If you are a user of the extension, it would be very useful if you could add yourself to the [[/Compatibility/]] page so I can get an idea of where problems may lie, and what also which older versions I might need to support if I decide to upgrade the minimum requirements.
+
See [[WikiDB/Defining data#Multi-value fields|the updated documentation]] for full details about this new feature and, as ever, check the [[/CHANGELOG#5.1.0|release notes]] for full details of changes made in this release.
  
== Versions ==
+
-- [[User:HappyDog|HappyDog]] ([[User talk:HappyDog|talk]]) 22:55, 7 February 2022 (GMT)
  
The version-numbering system I have adopted is based on two numbers:
+
=== v5.0.0 released ===
* The '''version''' number is incremented whenever ''incompatible'' changes are made. If you are using WikiDB and wish to upgrade to a new version with a higher version number, check out the [[/Changes|list of changes]] first, or things may break!  The version number can be seen on  [[Special:Version]] or at the top of the main [[/Files/WikiDB.php|WikiDB.php]] file.
+
* The '''revision''' number is incremented every time I make any changes at all to the code, ''or to other unrelated code that sits in the same repository''.  The revision number for each file can be seen at the top of the file, and the revision number for the extension is the highest of these numbers.  This is displayed at [[Special:Version]].  It is always safe to upgrade to a later revision, as long as the version number has not changed, and you ensure that ''all'' files are updated.
+
  
In both cases, the only significance of the numbers are that higher numbers are newer. I don't believe in sitting on a 0.x release branch for the rest of my life, so the first version I released is v1, and this will be updated as necessary according to the above rule.
+
I am pleased to announce the release of WikiDB v5.0.0.  This is the first release to use the new [[/Versioning|versioning scheme]].
  
If your version of the code doesn't have a version number, it is v1.  If it doesn't have a revision either, it is very old and should definitely be updated!
+
See the [[/CHANGELOG#5.0.0|release notes]] for full details.
 +
 
 +
One major change is that this release drops support for MediaWiki < 1.16.  I have always striven to maximise the compatibility of my extensions, and up until now WikiDB has proudly supported all MediaWiki versions back to v1.7However, some of the features of WikiDB have been impossible to support in older MediaWiki versions, so for some time now there has been a minimum requirement of MediaWiki 1.16 in order to experience the full set of features that WikiDB provides.
 +
 
 +
As I continue to add features to the extension, I am increasingly finding that there are things which are not possible without the parser rewrite that came in MediaWiki 1.16.  Therefore, rather than spending my energies trying to wring as much functionality as possible out of these older versions, I decided to raise my minimum version requirement for the extension to 1.16 and above.
 +
 
 +
This is a very conservative step - MediaWiki 1.16 was released in 2010 and is no longer officially supported.  However, as yet, I have not encountered any features that I need for WikiDB which are not supported by this version of MediaWiki, and therefore I see no reason to raise the bar any higher at this time.
 +
 
 +
If there are any users of MediaWiki < 1.16 who are unable to upgrade, the [[/Legacy versions|older versions of WikiDB]] remain available.
 +
 
 +
Thank you for your understanding and support.
 +
 
 +
--[[User:HappyDog|HappyDog]] ([[User talk:HappyDog|talk]]) 20:57, 30 March 2019 (GMT)
 +
 
 +
== Documentation ==
 +
{{On MediaWiki.org}}
 +
 
 +
* '''Getting Started:'''
 +
** [[/Tutorial/]] - Read this first!
 +
** [[/Features/]] - A list of the extension's current and planned functionality.
 +
** '''[[/Installation/]] - Everything you need to know to get the extension working.'''
 +
** [[/Versioning/]] - What the version numbers mean.
 +
** [[/License/|License]] - CC BY-SA 2.0 UK
 +
* '''Using WikiDB:'''
 +
** [[/Defining data/]]
 +
** [[/Defining tables/]]
 +
** [[/Querying data/]]
 +
* '''Reference:'''
 +
** [[/Syntax/]] - Current syntax for all elements of the extension.
 +
** [[/Data types/]] - A list of currently supported data types.
 +
** [[/Tutorial: Creating your own data type/]]
 +
* '''Administering WikiDB:'''
 +
** [[/Configuration settings/]]
 +
** [[/Maintenance scripts/]]
 +
** [[/Upgrading/]]
 +
* '''Support:'''
 +
** [[/Bugs/|Bugs]] - Please report any bugs here.
 +
** [[/Feature requests/]] - Add any suggestions for new features to this page.
 +
** [[/Roadmap|Roadmap]] - My list of planned features, and general (non-bug) issues that need fixing.
 +
* '''[[/Index/]]'''
 +
<br clear="right">
  
 
== Technical Info ==
 
== Technical Info ==
* [[/Tables/]] - Details about the new tables that are required by the extension.
+
 
* [[/Files/]] - Listings of all the files required by the extension.
+
* [[/Unit testing/]] - Information about the unit tests included in the extension, including how to run them on your own wiki.
 +
* [[/Tables/]] - Details about the database tables that will be created by the extension.
  
 
__NOTOC__
 
__NOTOC__

Revision as of 22:08, 2 August 2022

This extension is currently installed on this wiki. Feel free to experiment with it!
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

Download WikiDB Here!
Installation instructionsCHANGELOGOlder versions

v5.1.2 released

This new release resolves a few issues relating to MediaWiki 1.38, as well as fixing an issue with the parsing of query criteria.

-- HappyDog (talk) 23:08, 2 August 2022 (BST)

v5.1.1 released

This is a bug-fix release to resolve a fatal error on MediaWiki 1.37.

-- HappyDog (talk) 18:54, 11 March 2022 (GMT)

v5.1.0 released

As well as fixing a number of breakages introduced by MediaWiki 1.37, this release has a cool new feature: Multi-value fields.

Multi-value fields provide a simple way of implementing what would normally be called many-to-many relationships to reference data. For example, if a Student may be in multiple Courses, you can now specify more than one value for the Course column when defining data to go into the Student table.

See the updated documentation for full details about this new feature and, as ever, check the release notes for full details of changes made in this release.

-- HappyDog (talk) 22:55, 7 February 2022 (GMT)

v5.0.0 released

I am pleased to announce the release of WikiDB v5.0.0. This is the first release to use the new versioning scheme.

See the release notes for full details.

One major change is that this release drops support for MediaWiki < 1.16. I have always striven to maximise the compatibility of my extensions, and up until now WikiDB has proudly supported all MediaWiki versions back to v1.7. However, some of the features of WikiDB have been impossible to support in older MediaWiki versions, so for some time now there has been a minimum requirement of MediaWiki 1.16 in order to experience the full set of features that WikiDB provides.

As I continue to add features to the extension, I am increasingly finding that there are things which are not possible without the parser rewrite that came in MediaWiki 1.16. Therefore, rather than spending my energies trying to wring as much functionality as possible out of these older versions, I decided to raise my minimum version requirement for the extension to 1.16 and above.

This is a very conservative step - MediaWiki 1.16 was released in 2010 and is no longer officially supported. However, as yet, I have not encountered any features that I need for WikiDB which are not supported by this version of MediaWiki, and therefore I see no reason to raise the bar any higher at this time.

If there are any users of MediaWiki < 1.16 who are unable to upgrade, the older versions of WikiDB remain available.

Thank you for your understanding and support.

--HappyDog (talk) 20:57, 30 March 2019 (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

  • Unit testing - Information about the unit tests included in the extension, including how to run them on your own wiki.
  • Tables - Details about the database tables that will be created by the extension.