Difference between revisions of "Template:Card query"
Dinoguy1000 (talk | contribs) (track cases of hardcoded queries being converted to {{Card query}} by just changing the "#ask:" to "Card query|") |
Dinoguy1000 (talk | contribs) (allow OCG-only and TCG-only as values for {{{medium}}}; track unknown {{{medium}}} and {{{type}}} values) |
||
Line 5: | Line 5: | ||
}}{{ #vardefine: $query_medium | {{ #switch: {{ #replace: {{ #replace: {{ lc: {{{medium}}} }} }} | - }} | }}{{ #vardefine: $query_medium | {{ #switch: {{ #replace: {{ #replace: {{ lc: {{{medium}}} }} }} | - }} | ||
| ocg | tcg | ocg/tcg | tcg/ocg | official = official | | ocg | tcg | ocg/tcg | tcg/ocg | official = official | ||
+ | | ocgonly = ocg-only | ||
+ | | tcgonly = tcg-only | ||
| anime = anime | | anime = anime | ||
| animeonly = anime-only | | animeonly = anime-only | ||
Line 12: | Line 14: | ||
| vgonly | videogameonly = vg-only | | vgonly | videogameonly = vg-only | ||
| nonofficial = non-official | | nonofficial = non-official | ||
− | | #default = | + | | #default = {{ #vardefine: $query_medium_unknown | 1 }} |
}} | }} | ||
}}{{ #vardefine: $query_medium_query | {{ #switch: {{ #var: $query_medium }} | }}{{ #vardefine: $query_medium_query | {{ #switch: {{ #var: $query_medium }} | ||
| official = [[Class 1::Official]] | | official = [[Class 1::Official]] | ||
+ | | ocg-only = [[Medium::OCG-only]] | ||
+ | | tcg-only = [[Medium::TCG-only]] | ||
| anime = [[Medium::Anime]] | | anime = [[Medium::Anime]] | ||
| anime-only = [[Category:Anime cards with no OCG/TCG counterpart]] | | anime-only = [[Category:Anime cards with no OCG/TCG counterpart]] | ||
Line 58: | Line 62: | ||
| ??? = ??? | | ??? = ??? | ||
| spell/trap | s/t | nonmonster | non-monster = non-monster | | spell/trap | s/t | nonmonster | non-monster = non-monster | ||
− | | #default = | + | | #default = {{ #vardefine: $query_card_type_unknown | 1 }} |
}} | }} | ||
}}{{ #vardefine: $query_card_type_query | {{ #switch: {{ #var: $query_card_type }} | }}{{ #vardefine: $query_card_type_query | {{ #switch: {{ #var: $query_card_type }} | ||
Line 241: | Line 245: | ||
{{ #pos: {{ #var: $query_query_lc }} | medium:: }} | {{ #pos: {{ #var: $query_query_lc }} | medium:: }} | ||
| [[Category:((Card query)) transclusions which should use (((medium)))]] | | [[Category:((Card query)) transclusions which should use (((medium)))]] | ||
+ | }}{{ #if: {{ #var: $query_medium_unknown }} | ||
+ | | [[Category:((Card query)) transclusions with an unknown (((medium))) value]] | ||
}}{{ #if: {{ #pos: {{ #var: $query_query_lc }} | card type }} | }}{{ #if: {{ #pos: {{ #var: $query_query_lc }} | card type }} | ||
| [[Category:((Card query)) transclusions which should use (((type)))]] | | [[Category:((Card query)) transclusions which should use (((type)))]] | ||
+ | }}{{ #if: {{ #var: $query_card_type_unknown }} | ||
+ | | [[Category:((Card query)) transclusions with an unknown (((type))) value]] | ||
}}{{ #if: {{{2|}}}{{{?Primary type|}}}{{{?Type|}}}{{{?Attribute|}}}{{{?Stars|}}}{{{?ATK string|}}}{{{?DEF string|}}} | }}{{ #if: {{{2|}}}{{{?Primary type|}}}{{{?Type|}}}{{{?Attribute|}}}{{{?Stars|}}}{{{?ATK string|}}}{{{?DEF string|}}} | ||
| [[Category:((Card query)) transclusions which were improperly converted from hardcoded queries]] | | [[Category:((Card query)) transclusions which were improperly converted from hardcoded queries]] |
Revision as of 20:15, 14 October 2019
SQLStore debug output
ASK Query
SQL Query
SELECT DISTINCT
t0.smw_id AS id,
t0.smw_title AS t,
t0.smw_namespace AS ns,
t0.smw_iw AS iw,
t0.smw_subobject AS so,
t0.smw_sortkey AS sortkey, t0.smw_sort,
t0.smw_title,
t0.smw_subobject
FROM
`smw_object_ids` AS t0
WHERE
t0.smw_iw!=':smw'
AND t0.smw_iw!=':smw-redi'
AND t0.smw_iw!=':smw-border'
AND t0.smw_iw!=':smw-intprop'
ORDER BY
t0.smw_sort ASC,
t0.smw_title ASC,
t0.smw_subobject ASC
LIMIT
55
OFFSET
0
t0.smw_id AS id,
t0.smw_title AS t,
t0.smw_namespace AS ns,
t0.smw_iw AS iw,
t0.smw_subobject AS so,
t0.smw_sortkey AS sortkey, t0.smw_sort,
t0.smw_title,
t0.smw_subobject
FROM
`smw_object_ids` AS t0
WHERE
t0.smw_iw!=':smw'
AND t0.smw_iw!=':smw-redi'
AND t0.smw_iw!=':smw-border'
AND t0.smw_iw!=':smw-intprop'
ORDER BY
t0.smw_sort ASC,
t0.smw_title ASC,
t0.smw_subobject ASC
LIMIT
55
OFFSET
0
SQL Explain
ID | select_type | table | type | possible_keys | key | key_len | ref | rows | Extra |
---|---|---|---|---|---|---|---|---|---|
1 | SIMPLE | t0 | ALL | smw_iw,smw_iw_2 | 5028484 | Using where; Using filesort |
Auxilliary Tables
No auxilliary tables used.Query Metrics
Query-Size:0Query-Depth:0
Errors and Warnings
The query description has an empty condition.The query description has an empty condition.
#ask
query:- $query_query:
- $query_query_lc:
- $query_medium:
- $query_medium_query:
- $query_query_medium:
- $query_card_type:
- $query_card_type_query:
- $query_col_card_type:
?Card type =
- $query_col_primary_type:
- $query_col_secondary_type:
- $query_col_attribute:
- $query_col_type:
- $query_col_stars:
- $query_col_scale:
- $query_col_link_rating:
- $query_col_atk:
- $query_col_def:
- $query_col_card_type_st:
?Card type = [[Card type]]
- $query_col_property:
?Property = [[Property]]
{{{extra_column}}}
:{{{extra_label}}}
:- $query_col_extra:
- limit: 50
- $query_sort:
#
- $query_order:
- $query_count: