Raw SQL
Using Raw SQL to Get Results
This guide will walk you through running raw SQL queries directly in Draxlr. Follow the steps below to switch to Raw Query mode, write queries, and view results.
How to run Raw SQL Code?
1. Switch to Raw Query Mode
Click on Switch to Raw Query to enter the raw SQL editor.
2. Enter Your SQL Query
In the editor area, type your SQL query. For example:
SELECT * FROM `Orders` WHERE `Orders`.`EmployeeID` = 2;
3. Format the SQL Query
Click on Format Query to beautify and organize the SQL code for better readability.
4. Add Variables (Optional)
You can add variables to your queries using double curly braces.
For example: {{employeeId}}
SELECT * FROM `Orders` WHERE `Orders`.`EmployeeID` = {{employeeId}};
5. Set Variable Data Type and Value
Choose the appropriate data type (e.g., Numeric, String) and enter a value for the variable.
6. Execute the Query
Click on Execute Query to run your SQL statement and display the results in a tabular format.
Summary
- Switch to Raw Query mode.
- Write or paste your SQL query.
- (Optional) Add variables for dynamic inputs.
- Format the SQL for readability.
- Execute the query to view results.
This allows you to explore your data flexibly using raw SQL while benefiting from Draxlr’s interactive environment.