Module:Cargo/doc

Lua module to perform certain Cargo actions. If nothing breaks using Cargo's parser functions such as, chances are your code does not need to use this module at all.

The functions in this module are designed to be invoked directly from wikitext.

query1
Performs a Cargo query on one field, and returns a single result. There are two known situations where the standard  will fail:
 * The fields parameter is too long.
 * The query returns wikitext that may be stored into Cargo tables.

This function should behave as if  is called with the extra arguments ,  ,  , and  , except returned wikitext is not immediately expanded. This allows any wikitext generated from the fields argument to be preserved.

Parameters

 * tables, join on, where, group by, having, order by, offset
 * Correspond to 's parameters of the same name.


 * fields
 * The single field to query. The function does not check if more than one field is specified.


 * default
 * The string value to return if the query returns no results. If omitted, returns the empty string.


 * warn
 * Warning text to display when previewing an edit when no result is returned from the query.