SQLY provides powerful support for querying and manipulating JSON data and array structures, enabling efficient handling of semi-structured data.
SQLY allows extracting and filtering data from JSON objects.
json_query:
select: [customer_id, profile.name]
from: customers
where:
profile.age: "> 30"This extracts the name field from the profile JSON object and filters customers older than 30.
json_query:
select: [order_id, items]
from: orders
where:
items[*].category: "electronics"This retrieves orders containing items in the electronics category.
SQLY enables updates and modifications within JSON structures.
json_modify:
update: customers
set:
profile.status: "VIP"
where:
customer_id: 123This updates the status field inside the profile JSON object.
Arrays are supported for querying and filtering within SQLY.
array_query:
select: [user_id, roles]
from: users
where:
roles: contains("admin")This retrieves users who have admin in their roles array.
array_query:
select: [user_id, unnest(permissions)]
from: usersThis expands the permissions array into individual rows.
- Query JSON fields using dot notation.
- Filter JSON arrays with wildcard
[*]. - Modify JSON data using structured updates.
- Work with arrays using
contains()andunnest().