Getting Started with Looker SQL Runner
To get started with Looker SQL Runner, you will need to have a Looker account and a connection to your Looker data. Once you have these, you can follow these steps to install and start using Looker SQL Runner:
Enter a SQL query in the text box below the Query bar.
Optionally, select a table name or field from the field list to include it in your query at the cursor location.
Select Run to run the query against your database.
View the results in the Results area. SQL Runner will load up to 5,000 rows of the query’s result set. For SQL dialects that support streaming, you can download the results to see the entire result set.
Adding a SQL Runner query to a LookML project
Follow these steps to use the Add to Project option:
Use SQL Runner to create a SQL query that you want to use for a derived table.
Click Add to Project from the gear menu in the upper right.
Select the project you want to add this derived table to.
Enter a view name for the derived table.
Click Add to add the query as a derived table in your project. Looker will switch to Development Mode if not already in it, create a new view file with the LookML from the SQL Runner query, and then open the IDE file browser to the new view file.
Move the file to suit your project’s file organization.
Create a derived table from a SQL Runner query
Use SQL Runner to create a SQL query that you want to use for a derived table.
Click the gear menu and select Get Derived Table LookML.
From the Get Derived Table LookML pop-up, click the add it to your project link.
Note: It’s easier to use the add it to your project link, but you also have the option to copy the LookML, manually create a view file in your project, and paste the LookML to your new view file.Use the drop-down Project list to choose the project you would like to add the derived table to.
Enter a name for the new view in the View Name field. See the Managing LookML files and folders page for file naming conventions.
Click the Add button. Looker will switch to Development Mode if not already in it, create a new view file with the LookML from the SQL Runner query, and then open the IDE file browser to the new view file.
Move the file to suit your project’s file organization.
Debugging using SQL Runner
SQL Runner highlights the location of errors in the SQL command and includes the position of the error in the error message.
Please refer to below resources for more details: