Skip to main content

Query JSON using SQL

You can seamlessly query data from non-SQL sources as SQL using DronaHQ's built-in Query JSON with SQL. It harnesses the power of AlaSQL, which employs its own syntax that differs from traditional SQL. For instance, AlaSQL uses square brackets or backticks to enclose column names containing whitespace, in contrast to double quotes. To explore further details, you can refer to the AlaSQL docs.

To get started, simply choose 'Query JSON with SQL' in the Data query section. The Query JSON with SQL resource readily accepts an array of JSON objects within its FROM clause, making data retrieval and manipulation a breeze.

Query JSON using SQL
Query JSON using SQL

Example1: Query Raw JSON

  select * 
from {{ [{ age: 5, name: John }, { age: 8, name: Doe }] }}
where age > 6

Example2: Join JSON arrays

select *
from {{ programs.data }} as programs
join {{ centers.data }} as centers
on programs.id = centers.id