Actions

Template

JourneyMaterialsDebug: Difference between revisions

From Dune Awakening DB

Created page with "<includeonly><!-- Debug version to test the query --> <div style="background: #333; border: 2px solid yellow; padding: 15px; color: white;"> <h3>Debug Info for Journey {{{id|{{{1|}}}}}}</h3> <h4>1. Testing Basic Query (no joins):</h4> {{#get_external_data:source=externaldb |from=data_journey_objectives |data=journey_id=journey_id,objective_name=name |where=journey_id={{{id|{{{1|}}}}}} }} {{#for_external_table:| Journey {{{journey_id}}}: {{{objective_name}}}<br/> }}..."
 
mNo edit summary
Line 1: Line 1:
<includeonly><!-- Debug version to test the query -->
<includeonly><!-- Debug version 2 - find correct columns -->
<div style="background: #333; border: 2px solid yellow; padding: 15px; color: white;">
<div style="background: #333; border: 2px solid yellow; padding: 15px; color: white;">
<h3>Debug Info for Journey {{{id|{{{1|}}}}}}</h3>
<h3>Finding Correct Column Names</h3>


<h4>1. Testing Basic Query (no joins):</h4>
<h4>1. Journey Objectives Columns:</h4>
{{#get_external_data:source=externaldb
{{#get_external_data:source=externaldb
  |from=data_journey_objectives
  |from=data_journey_objectives
  |data=journey_id=journey_id,objective_name=name
  |data=id=id,journey_id=journey_id,objective_name=objective_name,description=description
  |where=journey_id={{{id|{{{1|}}}}}}
  |where=journey_id={{{id|{{{1|}}}}}}
|limit=1
}}
}}
{{#for_external_table:|
{{#for_external_table:|
Journey {{{journey_id}}}: {{{objective_name}}}<br/>
ID: {{{id}}}, Journey: {{{journey_id}}}, Name: {{{objective_name}}}, Desc: {{{description}}}<br/>
}}
}}


<h4>2. Testing Task Components:</h4>
<h4>2. Journey Tasks for this Journey:</h4>
{{#get_external_data:source=externaldb
|from=data_journey_tasks
|join on=data_journey_objectives.id=data_journey_tasks.objective_id
|data=task_id=data_journey_tasks.id,task_name=data_journey_tasks.task_name,objective_id=data_journey_tasks.objective_id
|where=data_journey_objectives.journey_id={{{id|{{{1|}}}}}}
|limit=3
}}
{{#for_external_table:|
Task ID: {{{task_id}}}, Name: {{{task_name}}}, Objective: {{{objective_id}}}<br/>
}}
 
<h4>3. Task Components (what items are needed):</h4>
{{#get_external_data:source=externaldb
|from=data_journey_task_components
|data=task_id=task_id,item_name=item_name,quantity=quantity
|limit=5
}}
{{#for_external_table:|
Task: {{{task_id}}}, Item: {{{item_name}}}, Qty: {{{quantity}}}<br/>
}}
 
<h4>4. Components for Journey {{{id|{{{1|}}}}}}:</h4>
{{#get_external_data:source=externaldb
{{#get_external_data:source=externaldb
  |from=data_journey_task_components
  |from=data_journey_task_components
  |join on=data_journey_tasks.id=data_journey_task_components.task_id,data_journey_objectives.id=data_journey_tasks.objective_id
  |join on=data_journey_tasks.id=data_journey_task_components.task_id,data_journey_objectives.id=data_journey_tasks.objective_id
  |data=component_name=data_journey_task_components.component_name
  |data=item_name=data_journey_task_components.item_name,quantity=data_journey_task_components.quantity
  |where=data_journey_objectives.journey_id={{{id|{{{1|}}}}}}
  |where=data_journey_objectives.journey_id={{{id|{{{1|}}}}}}
|limit=5
}}
}}
Components: {{#for_external_table:|{{{component_name}}} | }}
Items needed: {{#for_external_table:|{{{item_name}}} (x{{{quantity}}}) | }}


<h4>3. Testing if view exists (simple select):</h4>
<h4>5. Sample data from recipe view:</h4>
{{#get_external_data:source=externaldb
{{#get_external_data:source=externaldb
  |from=vw_recipe_inputs_by_level
  |from=vw_recipe_inputs_by_level
  |data=root_item=root_item,level=level
  |data=root_item=root_item,item_label=item_label,level=level,total_qty=total_qty
  |limit=3
  |limit=5
}}
{{#for_external_table:|
{{{root_item}}} → Level {{{level}}}: {{{item_label}}} x{{{total_qty}}}<br/>
}}
}}
{{#for_external_table:|Level {{{level}}} - {{{root_item}}}<br/>}}


</div>
</div>
</includeonly><noinclude>
</includeonly><noinclude>
This template helps debug the materials query.
This finds the correct column names for the journey materials query.


Usage: <nowiki>{{JourneyMaterialsDebug|id=4}}</nowiki>
Usage: <nowiki>{{JourneyMaterialsDebug2|id=4}}</nowiki>
</noinclude>
</noinclude>

Revision as of 13:57, 31 May 2025

This finds the correct column names for the journey materials query.

Usage: {{JourneyMaterialsDebug2|id=4}}