SQLY (Standard Query Language) is a YAML-based query language designed for structured and semi-structured data. It is inspired by JQL, Kusto, and DQL while offering a human-readable syntax.
A simple SQLY query consists of the following components:
select: Specifies the fields to retrieve.from: Defines the data source.where: Filters the results.order_by: Sorts the results.limit: Limits the number of returned rows.
query:
select: [id, name, email]
from: users
where:
status: active
order_by: name ASC
limit: 50query:
select: [order_id, customer, total_price]
from: orders
where:
total_price:
gt: 100
order_by: total_price DESCSQLY supports multiple conditions using logical operators:
| Operator | Description |
|---|---|
gt |
Greater than |
lt |
Less than |
gte |
Greater than or equal |
lte |
Less than or equal |
in |
Matches any value in a list |
not |
Negates a condition |
query:
select: [order_id, customer, total_price]
from: orders
where:
total_price:
gte: 500
customer:
in: ["Alice", "Bob", "Charlie"]query:
select: [id, name]
from: users
where:
role:
not: adminSQLY allows aggregation functions with group_by.
query:
select:
- customer_id
- avg: total_price
from: orders
group_by: customer_id- Use
selectto define fields. fromspecifies the data source.whereapplies filtering.- Use
order_byfor sorting results. - Apply
group_byfor aggregations.
Proceed to Advanced Features to explore more capabilities.