@lakeql/query-builder turns GraphQL query intent into SQL. You give it selected fields, a filter, sorting, and paging. It produces a compiled, adapter-neutral query that the data source's dialect renders into engine-specific SQL.
You rarely call it directly. The generated query schemas use it under the hood. Knowing its inputs still helps when you write custom resolvers or debug a generated query.
1
2
3
4
5
6
7
8
9
10
11
12
13
import { generateQuery } from "@lakeql/query-builder"
const compiled = generateQuery({
dialect,
catalog: "hive",
schema: "sales",
table: "orders",
selectFields: ["id", "status", "total"],
userQuery: { status: { eq: "shipped" } },
sorting: [{ field: "id", direction: "asc" }],
paging: { limit: 20 },
})
This section covers filtering and sorting and paging. The full API reference comes at the end.