Template:VarQuery/doc

From Dota 2 Wiki
Jump to: navigation, search
Lua logo.svg
▶️ Swapsies!
This template uses Lua.
Its code can be found under Module:VarQuery.


This template performs a Cargo query and stores its results into variables that can be used later on. The query must not yield more than one result.

Usage[edit]

The argument names are identical to the #cargo_query arguments. The following are available:

{{VarQuery
| tables = 
| fields = 
| where = 
| join on = 
| group by = 
| having = 
| order by = 
}}
Note:
  • |table= and |field= may be used instead of |tables= and |fields=.
  • |fields= defaults to _pageName

The values get stored into variables. The variable names are the field names prefixed with cargo_.

Example[edit]

{{VarQuery
| tables = heroes
| fields = image, primary_attribute
| where = _pageName="Axe"
}}

* {{#var:cargo_image}}
* {{#var:cargo_primary_attribute}}


  • File:Axe icon.png
  • Strength

TemplateData[edit]

No description.

Template parameters

This template has custom formatting.

ParameterDescriptionTypeStatus
Tablestablestable

no description

Default
empty
Example
heroes
Auto value
empty
Stringrequired
Fieldsfieldsfield

no description

Default
_pageName
Example
empty
Auto value
empty
Stringsuggested
Wherewhere

no description

Default
empty
Example
_pageName="Axe"
Auto value
empty
Stringsuggested
Join onjoin on

no description

Default
empty
Example
empty
Auto value
empty
Stringoptional
Group bygroup by

no description

Default
empty
Example
empty
Auto value
empty
Stringoptional
Havinghaving

no description

Default
empty
Example
empty
Auto value
empty
Stringoptional
Order byorder by

no description

Default
empty
Example
empty
Auto value
empty
Stringoptional
Limitlimit

A limit of 1 may be set. This will supress the error multiple results usually produce.

Default
empty
Example
empty
Auto value
empty
Numberoptional
Variable prefixprefix

no description

Default
cargo_
Example
empty
Auto value
empty
Stringoptional