Cargo

Please remove this template after page has been updated.

Cargo is a MediaWiki extension that allows data to be stored in a SQL database and then queried from said database. The Battlerite Royale Wiki uses Cargo to store some information about the game, such as data about Abilities and Battlerites. Cargo provides the ability to store the data in one place, and display it in multiple places and formats through querying.

A basic understanding of SQL helps when working with Cargo, but is **NOT** required to edit data that uses Cargo here on the Battlerite Royale Wiki.

## Cargo Syntax

Cargo is built on top of the MediaWiki markup. All interactions with the database are done by editing pages on the Battlerite Royale Wiki. To get a quick overview of how to store and query data through Cargo, see the Cargo Quick Start Guide.

## Storing Data

A comprehensive guide to Storing data in a database with Cargo can be found here.

### Example

A specific example of storing data with Cargo on the Battlerite Royale Wiki is Template:Ability\_Data, which defines the table for character abilities. Cargo tables are built by creating templates which hold a {{#cargo\_declare:...}} invocation inside of a noinclude tag. This defines the parameters of the database.

The Template:Ability\_Data also defines how data will be stored into the table through the {{#cargo\_store:...}} invocation inside of the includeonly tag. When the Template:Ability\_Data is used on any page of the wiki, that data will then be stored in the database. An example of this is Ashka/Data/Abilities, which defines all of Ashka's abilities. Editing the data on that page will change the database, and affect information about Ashka's abilities across the site.

A third note about the Template:Ability\_Data is that by calling the template, it both stores the data to the database and displays the information on the page in which it is called. As Cargo uses template calls to store data, any other use that a function might serve can also be added to that template. In this case, a small table is shown that displays the data entered into the template.

## Querying Data

A comprehensive guide to Querying data in a database with Cargo can be found here.

### Example

A specific example of querying data with Cargo on the Battlerite Royale Wiki is Template:Ability\_Large, which queries data for a specific character and ability, and puts that queried data into a styled template.

Querying data is done through a {{#cargo\_query:...}} invocation, with parameters for the query. Specifics on the parameters of the query can be referenced from the guide above.

When the data has been retrieved from the database, it is then passed to a separate template Template:Ability\_Large\_Baseline through the *template=Ability Large Baseline* parameter within the query invocation.

## Viewing Data

On the Battlerite Royale Wiki we strive to make all data entered into the database visible on the page in which it was entered. This also means that extra pages are usually created specifically for the purpose of storing that data, such as Ashka/Data/Abilities and Ashka/Data/Battlerites.

Cargo provides special pages that show the information in the database located at Special:CargoTables.

To show links to data pages on the champion tabs add your name on Template:ShowDataLinks.