SQL Lab is a modern, feature-rich SQL IDE written in React.
Connects to just about any database backend
A multi-tab environment to work on multiple queries at a time
A smooth flow to visualize your query results using Superset's rich visualization capabilities
Browse database metadata: tables, columns, indexes, partitions
Support for long-running queries - uses the Celery distributed queue
to dispatch query handling to workers
- supports defining a "results backend" to persist query results
A search engine to find queries executed in the past
Supports templating using the Jinja templating language which allows for using macros in your SQL code
- Hit
alt + enter
as a keyboard shortcut to run your query
SELECT *
FROM some_table
WHERE partition_key = '{{ presto.latest_partition('some_table') }}'
Templating unleashes the power and capabilities of a programming language within your SQL code.
Templates can also be used to write generic queries that are parameterized so they can be re-used easily.
We expose certain modules from Python's standard library in
Superset's Jinja context:
- time
: time
- datetime
: datetime.datetime
- uuid
: uuid
- random
: random
- relativedelta
: dateutil.relativedelta.relativedelta
- more to come!
Jinja's builtin filters can be also be applied where needed.
.. autoclass:: superset.jinja_context.PrestoTemplateProcessor :members: