-
Notifications
You must be signed in to change notification settings - Fork 13
MySQL database connectivity
WebStats also supports getting data from a MySQL database. Because plugins can use wildly different formats to store their data, WebStats' configuration format is also very flexible. For every table in the database to use, you can specify a list of conversion functions, which will be executed one after the other. That way, the format of the database gets converted to the format WebStats can understand and show, one conversion at a time.
Currently, the conversion functions available (with the arguments they take) are:
-
filter
(column
, ...): only keeps columns which appear in the list of arguments. -
remove
(column
, ...): opposite of filter: removes all columns which appear in the list of arguments. -
rename
(from-column
,to-column
): renames thefrom-column
column toto-column
. -
json
(column
): extracts the JSON from columncolumn
and creates columns for all keys in the JSON object (the JSON needs to be an object, not an array) -
key-value
(key-column
,value-column
): takes a key-value pair stored in two separate columns, makes a column for the key (with namekey-column
) and stores the value from thevalue-column
in that column. -
uuid
(column
): converts the UUIDs incolumn
to player names and renames the column toplayer
.
The functions above are not written in the way that they should appear in the config file. You should write them in a list, where the function name is the first item in the list and the arguments follow, like this:
- [filter, column1, column2, column3]
- [key-value, key-column, value-column]
More information can be found in the config file page