DQL Manager

Manages DQL Preview and Custom SQL actions over Space and Time

Various ways to test tables by previewing the top 10 rows

  • npx hardhat sxt-utils:insertIntoTable --schema sxt_utils --businessobject ToDo
  • npx hardhat sxt-utils:previewTable --schema sxt_utils --businessobject ToDo
  • npx hardhat sxt-utils:previewTable --schema sxt_utils --table lists
  • npx hardhat sxt-utils:previewTable --schema sxt_utils --table tasks
  • npx hardhat sxt-utils:previewTable --schema sxt_utils --table lists,tasks --query getListTasks

Custom queries can be defined in schemas/<schema>/sql/udf-custom/<query>.sql

Replace argument specified in the SQL file should have the literal schema

// getListTasks.sql
SELECT t.id as task_id, 
       t.task,
       t.complete,
       l.id as list_id,
       l.list
FROM <SCHEMA>.TASKS t
JOIN <SCHEMA>.LISTS l  
ON t.list_id = l.id
WHERE l.id = 1 

The table parameter must contain the list of tables that are used in the SQL query

  • npx hardhat sxt-utils:queryTable --schema <schema> --table lists,tasks --query getListTasks

What’s Next