Lightdash Handler
This handler allows you to interact with a Lightdash instance
About Lightdash
Lightdash instantly turns your dbt project into a full-stack BI platform. Analysts write metrics and Lightdash enables self-serve for the entire business.
Lightdash Handler Initialization
You can create the database like so:
CREATE DATABASE lightdash_datasource
WITH ENGINE = "lightdash",
PARAMETERS = {
"api_key": "...",
"base_url": "https://..."
};
To select from various tables, you can use SELECT statement. You must provide a package for this to work.
SELECT * FROM lightdash_datasource.user;
SELECT firstName FROM npm_datasource.maintainers;
Some tables requre additional parameters that can be passed through WHERE clause separated by ANDs:
SELECT * FROM lightdash_datasource.project_table
WHERE project_uuid='....';
Available tables
user: details of authenticated useruser_abilities: list of abilities of authenticated userorg: details of organization of authenticated userorg_projects: list of projects under authenticated user's organizationorg_members: list of members of authenticated user's organizationproject_table: details of project defined byproject_uuidwarehouse_connection: details of the warehouse to which project withproject_uuidis connecteddbt_connection: details of dbt connection to which project withproject_uuidis connecteddbt_env_vars: list of environment variables of dbt connection to which project withproject_uuidis connectedcharts: list of charts in project withproject_uuidspaces: list of spaces in project withproject_uuidaccess: list of users with access to project withproject_uuidvalidation: list of validation results of the project withproject_uuiddashboards: list of dashboards defined in spacespace_uuidof projectproject_uuidqueries: list of queries in the spacespace_uuidof projectproject_uuidchart_history: history of changes of chartchart_uuidchart_config: configuration of chart defined by versionversion_uuidand chartchart_uuidchart_additional_metrics: additional metrices used in chart defined by versionversion_uuidand chartchart_uuidchart_table_calculations: table calculations used in chart defined by versionversion_uuidand chartchart_uuidscheduler_logs: logs of scheduler in projectproject_uuidscheduler: details of scheduler withscheduler_uuidscheduler_jobs: jobs scheduled by scheduler withscheduler_uuidscheduler_job_status: status of a job withjob_id