Query Language (AQL)
Axel Query Language (AQL)
Section titled “Axel Query Language (AQL)”AQL is a query language that compiles to parameterized PostgreSQL SQL. You write queries in .aql files; Axel outputs SQL strings you execute with your language’s standard driver. Axel never runs queries for you.
query.aqlHow AQL is organized
Section titled “How AQL is organized”The reference is split by feature:
- Parameters — named, optional, and typed query parameters.
- Select — single vs multi, shapes, filters, ordering, nested links, and aggregates.
- Insert — inserting rows, links, and
unless conflictupserts. - Update — updates and partial updates.
- Delete — deleting rows.
- Expressions — operators, literals, path expressions, and casts.
- With — bind a subquery once with
with (...)and reuse it across the query. - Directives —
@name/@request/@responsecodegen metadata. - Grammar reference — the full AQL grammar.
Output format
Section titled “Output format”Every compiled query produces:
- A positional-parameter SQL string (
$1,$2, …) - A comment header mapping parameter names to positions
-- $1: email (str)-- $2: active (bool)SELECT u.id AS id, u.email AS emailFROM "user" uWHERE u.email = $1 AND u.active = $2;The parameter order matches first-appearance order in the query.