Features / SQL Editor

SQL Editor for your database

Run any query your database supports, from quick lookups to CTEs and window functions. Chart the results, share them on a dashboard, and reuse the same query with variables.

Trusted by teams at

DeelComcastCompTIABerklee

Overview

What is Raw Query in Draxlr?

Write the SQL yourself and run it against your connected database. Use it when a question needs a CTE, a window function, or a database-specific function, or when you already have the SQL and want it on a dashboard.

A raw query can be saved, charted, added to dashboards, and watched by alerts. Two pieces of syntax make one query reusable for many values:

SyntaxWhat it does
{{variable}}A value filled in when the query runs, from the Variables panel or a dashboard filter.WHERE EmployeeID = {{employeeId}}
[[ ... ]]An optional section. It runs only when every variable inside it has a value, and is left out otherwise.[[ WHERE orders.employee_id = {{ employeeId }} ]]

In action

Write SQL, get answers from your database.

Reuse any query with variables and put the results on a dashboard your team can see.

01 / Write

Write any SQL your database supports

Open Raw Query and write SQL in your database's own dialect, including CTEs, window functions, subqueries, and vendor-specific functions. Format Query tidies the layout in one click, and Execute Query runs it against your live database and shows the rows.

  • Your database's own SQL dialect
  • Format Query for readable code
  • Live results, nothing stored by Draxlr
02 / Variables

Turn values into variables

Wrap a name in double curly braces and it appears in the Variables panel. Give it a type such as Numeric or Text, enter a value, and rerun the same query for another employee, customer, or date without editing the SQL.WHERE orders.employee_id = {{ employeeId }}

03 / AI Assistant

Edit SQL and visualizations with AI

Tell the AI assistant in the editor what to change in plain English, for example to only show orders from the last 30 days, and it rewrites your SQL. Ask it to change the visualization the same way, without leaving the editor.

Use cases

What Teams Build with the SQL Editor

When a question needs more than clicks, the SQL editor turns it into a saved query anyone on the team can rerun.

01

Analysts: questions the builder can't express

Retention cohorts, running totals, period-over-period change, and recursive hierarchies all need CTEs or window functions. Write them directly, then save the query and chart the result.

02

Data teams: bring the SQL you already have

Paste queries from your SQL client, a notebook, or another BI tool, run them as they are, and put the results on a shared dashboard instead of a screenshot in Slack.

03

Customer success: one query for every account

Write the account lookup once with an {{accountId}} variable and connect it to a dashboard filter. Anyone on the team can then pull up a customer's orders, usage, or invoices without touching SQL.

04

Finance & ops: reports with optional date ranges

Wrap the start and end dates in optional sections. Leave them empty for all-time totals, or fill them in for a month-end report, all from the same saved query.

Feature Highlights

Other Top Features

01

Make filters optional

Wrap a condition in double square brackets and it only runs when every variable inside it has a value. Leave the variable empty and the condition is skipped, so the same query also returns every row.[[ WHERE orders.employee_id = {{ employeeId }} ]]

02

Export to CSV or Excel

Download the results of any raw query as a CSV or Excel file. The file contains exactly what the query returns.

Connectors

Works with your favorite SQL databases

Draxlr can connect with PostgreSQL, MySQL, MariaDB, PlanetScale, CockroachDB, YugabyteDB, Microsoft SQL Server, Redshift, BigQuery, Supabase, ClickHouse, Databricks, and Snowflake.

FAQ

SQL Editor FAQs

When should I use Raw Query instead of the query builder?

Use the query builder for filters, joins, and summaries you can set up with clicks. Reach for Raw Query when a question needs SQL the builder can't express, such as CTEs, window functions, or database-specific functions, or when you already have the SQL written. Draxlr AI can also write the SQL for you from a plain English question. Queries made all three ways are saved the same way and work the same on dashboards.

How do variables work in a Draxlr SQL query?

Wrap a name in double curly braces, for example WHERE EmployeeID = {{employeeId}}. Draxlr lists each variable beside the editor, where you choose its data type, such as Numeric or Text, and enter a value. Execute Query then runs the SQL with that value in place.

How do I make a filter optional in a SQL query?

Wrap the condition in double square brackets, for example [[ WHERE orders.employee_id = {{ employeeId }} ]]. The section is included only when every variable inside it has a value, and left out otherwise, so the same query works with or without the filter.

Can dashboard filters pass values into my SQL?

Yes. Add a Raw SQL Query Variable filter to the dashboard, choose its data type (Text, Numeric, Boolean, Date & Time, Date, or Time), and map it to a variable in your query. Turn on multiple values when your SQL uses IN or NOT IN, for example WHERE EmployeeID IN ({{employeeIds}}). When a viewer changes the filter, the connected dashboard elements rerun with the new values.

Which databases does the SQL editor work with?

The SQL editor works with every database Draxlr connects to, including PostgreSQL, MySQL, SQL Server, MariaDB, Supabase, PlanetScale, CockroachDB, YugabyteDB, Neon, BigQuery, Snowflake, ClickHouse, Redshift, and Databricks.

Can my customers write SQL inside my app?

Yes, with Full App Embed. It adds an analytics workspace to your product where each customer gets the dashboards you share with them, plus their own dashboards, a query builder, a SQL editor, and the AI assistant. Row-level security keeps each customer to their own data.

Our customers

Trusted by teams
that run on their data

From fast-growing startups to global enterprises, teams choose Draxlr to explore, visualize, and share insights from their databases.

Rating on G2
4.8 / 5
Databases supported
14+
DeelComcastBerkleeCompTIADope MarketingSports NowGipperField Bots

Trusted by teams

Customer Reviews

Founders, operators, and product teams rely on Draxlr for clear dashboards, faster decisions, and dependable support.

4.8/5

On G2

G2

Powerful and Beautiful Dashboards with Excellent Value and Support

Draxlr offers a clean, modern interface and makes it incredibly easy to build dashboards — even for non-technical users.

Ole, CEO

Read review
G2

Best for Dashboards based on Postgres

Super simple, almost no time to learn the tool. Draxlr is moving fast and building a lot of new valuable features.

Founder in Facilities Services domain

Read review
G2

Draxlr makes my data more useful and more collaborative

I've been using Draxlr for a year now and I LOVE it.

Varun, CEO

Read review
G2

Super easy to use and implement KPI visualization

Draxlr has completely transformed the way I work with data.

שלמה, OPs manager

Read review
G2

A plug'n'play Dashboard for Supabase

The query builder is honestly very intuitive and the graph elements very straightforward to understand.

Niklas, CTO

Read review
Capterra

A very useful tool

Very very good. The dashboards help us to understand in real time our customer behavior

Paolo, CTO

Read review

How it works

  1. Step 1

    Connect your database

    Sign up, add credentials, connect as many databases as you need.

  2. Step 2

    Ask or build a query

    Use the builder, AI or raw SQL to filter, join and summarize.

  3. Step 3

    Share, embed, alert

    Pin to dashboards, embed in your app, or push to Slack and email.

Start free today

Every piece of your analytics, in one place.

Connect your database and the rest falls into place. Your first dashboard is minutes away.

No credit card required

This website uses cookies to ensure you get the best experience.