Skip to content

Commit 38795ec

Browse files
committed
Revise documentation to emphasize the dynamic query model, replacing references to stored queries with dynamic queries throughout various sections. Update project setup guides for Rust and TypeScript to reflect the new querying approach, and enhance clarity on query authoring and execution workflows. Additionally, add new sections for TypeScript project setup and querying guide, ensuring consistency in terminology and improving user guidance.
1 parent 94045e2 commit 38795ec

17 files changed

Lines changed: 1887 additions & 590 deletions

cli/workflows/helix_cloud.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ icon: "cloud"
77

88
> For the complete documentation index optimized for AI agents, see [llms.txt](/llms.txt).
99
10-
The Helix CLI's V2 Cloud surface covers authentication, workspace/project/cluster selection, instance metadata sync, log retrieval, and dynamic queries against a remote gateway. Cluster provisioning, scaling, and stored-procedure deployment happen in the Helix control plane — not in the CLI.
10+
The Helix CLI's V2 Cloud surface covers authentication, workspace/project/cluster selection, instance metadata sync, log retrieval, and dynamic queries against a remote gateway. Cluster provisioning and scaling happen in the Helix control plane — not in the CLI.
1111

1212
## Prerequisites
1313

database/architecture.mdx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -23,8 +23,8 @@ storage that can handle concurrent writes to the writer node and allows for virt
2323
The gateway is the entry point for all client traffic. For high availability, deploy at least
2424
three gateway instances per cluster. Smaller gateway fleets can be used for non-HA or test
2525
workloads, but they are not recommended for production. Gateways accept HTTP requests,
26-
authenticate the caller via Bearer token, resolve a stored query name or accept an inline query
27-
payload, and route the request to the writer or a reader. Mutations are always routed to the
26+
authenticate the caller via Bearer token, accept the inline query payload, and route the request
27+
to the writer or a reader. Mutations are always routed to the
2828
writer. Read-only queries are distributed across readers and the writer. Gateways handle
2929
connection management, load balancing, token validation, and the translation from HTTP requests to
3030
the backend query RPC.
@@ -103,7 +103,7 @@ regardless of cache state; caching affects latency, not correctness.
103103
Secondary, vector, and text indexes over the property graph.
104104
</Card>
105105
<Card title="Querying" icon="magnifying-glass" href="/database/querying">
106-
Traversal DSL, stored queries, dynamic queries, and transactions.
106+
Traversal DSL, dynamic queries, and transactions.
107107
</Card>
108108
<Card title="Guarantees" icon="shield-check" href="/database/guarantees">
109109
Consistency, durability, and isolation under this architecture.

database/introduction.mdx

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -35,14 +35,14 @@ Caches reduce steady-state latency and accelerate cold starts.
3535
text search artifacts keep hot-path reads fast.
3636
- **Full ACID transactions.** Every query runs in a serializable snapshot isolation transaction.
3737
Concurrent reads and writes do not block each other.
38-
- **Stored query model.** Queries are authored in a Rust DSL, deployed as stored procedures, and
39-
invoked by name over HTTP. No query parsing at runtime.
38+
- **Dynamic query model.** Queries are authored in a Rust or TypeScript DSL and sent to the
39+
runtime as dynamic HTTP requests that carry the query inline. No separate deployment step.
4040

4141
## Next Steps
4242

4343
<CardGroup cols={2}>
4444
<Card title="Working with Helix Cloud" icon="rocket" href="/database/working-with-enterprise">
45-
Deploy-time and runtime workflow for stored and dynamic queries.
45+
Authoring and runtime workflow for dynamic queries.
4646
</Card>
4747
<Card title="Architecture" icon="sitemap" href="/database/architecture">
4848
Gateway, writer, readers, object storage, and the cache hierarchy.
@@ -51,7 +51,7 @@ Caches reduce steady-state latency and accelerate cold starts.
5151
Run the `enterprise-dev` image in-memory or against MinIO.
5252
</Card>
5353
<Card title="Querying" icon="magnifying-glass" href="/database/querying">
54-
Traversal DSL, stored queries, dynamic queries, and transactions.
54+
Traversal DSL, dynamic queries, and transactions.
5555
</Card>
5656
</CardGroup>
5757

database/limits.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,6 @@ fundamental architectural boundaries.
5050

5151
| Limit | Value |
5252
| ----------------- | ------------------------------------ |
53-
| Query model | Stored procedures and runtime queries|
53+
| Query model | Dynamic queries |
5454
| Query language | Rust DSL |
5555
| Transaction scope | One transaction per query invocation |

database/local-development.mdx

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,8 @@ database together in a single container. The image supports two storage modes:
1313

1414
In both modes:
1515

16-
- If `PATH_TO_QUERIES` is unset, you can still use dynamic `POST /v1/query` requests.
17-
- If `PATH_TO_QUERIES` is set, the container loads stored queries from the mounted
16+
- If `PATH_TO_QUERIES` is unset, send queries as dynamic `POST /v1/query` requests.
17+
- If `PATH_TO_QUERIES` is set, the container preloads your query bundle from the mounted
1818
`queries.json` file during startup.
1919

2020
## Quick Start with the CLI
@@ -118,7 +118,8 @@ services:
118118
- ./queries.json:/workspace/queries.json:ro
119119
```
120120
121-
If you only want dynamic queries, omit `PATH_TO_QUERIES` and the mounted `queries.json` volume.
121+
To run without a preloaded bundle, omit `PATH_TO_QUERIES` and the mounted `queries.json` volume;
122+
queries still execute as dynamic `POST /v1/query` requests.
122123

123124
## On-Disk
124125

@@ -194,10 +195,10 @@ itself. Drop `AWS_ENDPOINT` and `AWS_ALLOW_HTTP` to talk to real AWS S3.
194195

195196
<CardGroup cols={2}>
196197
<Card title="Working with Helix Cloud" icon="rocket" href="/database/working-with-enterprise">
197-
Authoring `queries.json`, deploying stored queries, and the runtime workflow.
198+
Authoring `queries.json` and the runtime workflow.
198199
</Card>
199200
<Card title="Querying" icon="magnifying-glass" href="/database/querying">
200-
Traversal DSL, stored queries, dynamic queries, and transactions.
201+
Traversal DSL, dynamic queries, and transactions.
201202
</Card>
202203
<Card title="CLI Getting Started" icon="terminal" href="/cli/getting-started">
203204
Install the Helix CLI, scaffold a project, and send your first query.

database/querying-guide/advanced.mdx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -460,9 +460,9 @@ A few notes specific to `forEachParam`:
460460

461461
<CardGroup cols={2}>
462462
<Card title="Parameters and bundles" icon="gear" href="/database/querying-guide/parameters-bundles">
463-
`defineParams`, dynamic requests, stored bundles, typed call helpers.
463+
`defineParams`, dynamic requests, bundles, typed call helpers.
464464
</Card>
465465
<Card title="Querying overview" icon="book-open" href="/database/querying">
466-
The conceptual story: stored vs dynamic queries, transactions, and how the bundle is deployed.
466+
The conceptual story: dynamic queries, transactions, and the HTTP surface.
467467
</Card>
468468
</CardGroup>

database/querying-guide/overview.mdx

Lines changed: 21 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ title: 'Querying Guide: Overview'
66
77
This guide is a tutorial walkthrough of the HelixDB query language. Each page builds
88
on the last, starting from the simplest possible read and ending at parameter-bound
9-
stored bundles. Every example shows the **TypeScript**, **Rust**, and **JSON** form
9+
bundles. Every example shows the **TypeScript**, **Rust**, and **JSON** form
1010
side by side, so you can pick a client and follow along — or skim across all three to
1111
see how the surfaces relate.
1212

@@ -112,7 +112,7 @@ const aliceFeed = readBatch()
112112
)
113113
.returning(["user", "posts"]);
114114

115-
const body = aliceFeed.toDynamicJson(); // POST body for /v1/query
115+
const request = aliceFeed.toDynamicRequest(); // POST this to /v1/query
116116
```
117117

118118
```rust Rust
@@ -194,40 +194,33 @@ Two things to notice:
194194
## Sending the request
195195

196196
The JSON above is the actual body for `POST /v1/query`. Below are the same request
197-
in three transports — TypeScript using `fetch`, Rust using `reqwest`, and `curl`
197+
in three transports — TypeScript and Rust using their SDK clients, and `curl`
198198
straight from the shell. All three are interchangeable; pick whichever fits your
199199
environment.
200200

201201
<CodeGroup>
202202
```ts TypeScript
203203
// Continuing from the snippet above.
204-
const response = await fetch("https://helix.example.com/v1/query", {
205-
method: "POST",
206-
headers: { "content-type": "application/json" },
207-
body: aliceFeed.toDynamicJson(),
208-
});
209-
210-
if (!response.ok) {
211-
throw new Error(`Helix returned ${response.status}`);
212-
}
204+
import { Client } from "@helix-db/helix-db";
205+
206+
const client = new Client("https://helix.example.com");
213207

214-
const { user, posts } = await response.json();
208+
const { user, posts } = await client
209+
.query<{ user: unknown; posts: unknown }>()
210+
.dynamic(request) // from .toDynamicRequest() above
211+
.send();
215212
```
216213

217214
```rust Rust
218-
// alice_feed() returns a ReadBatch; build a DynamicQueryRequest and post it.
219-
use helix_db::dsl::prelude::*;
215+
// alice_feed() returns the request to POST to /v1/query.
216+
use helix_db::Client;
220217

221-
let body = DynamicQueryRequest::read(alice_feed()).to_json_string()?;
218+
let client = Client::new(Some("https://helix.example.com"))?;
222219

223-
let response = reqwest::Client::new()
224-
.post("https://helix.example.com/v1/query")
225-
.header("content-type", "application/json")
226-
.body(body)
220+
let response: serde_json::Value = client
221+
.query()
222+
.dynamic(alice_feed())
227223
.send()
228-
.await?
229-
.error_for_status()?
230-
.json::<serde_json::Value>()
231224
.await?;
232225

233226
let user = &response["user"];
@@ -271,11 +264,8 @@ The response is a JSON object keyed by the names from `.returning([...])` — he
271264
`{ "user": [...], "posts": [...] }`. Each value is the list of rows produced by that
272265
named binding.
273266

274-
If this query were deployed as a *stored* route under the name `alice_feed`, the
275-
client would hit `POST /v1/query/alice_feed` with a much smaller body (just the
276-
parameters object — empty `{}` here, since this query takes none). The
277-
[Parameters and bundles](/database/querying-guide/parameters-bundles) page walks
278-
through both shapes.
267+
The [Parameters and bundles](/database/querying-guide/parameters-bundles) page shows
268+
how to bind parameters and organize queries into a `queries.json` bundle.
279269

280270
## How to read this guide
281271

@@ -287,9 +277,8 @@ Each page follows the same template:
287277
3. The **Rust** tab mirrors the TypeScript exactly, with snake-case method names and
288278
the trailing-underscore convention for Rust keywords (`where_`, `in_`, `as_`).
289279
4. The **JSON** tab is the serialized AST that either DSL produces. It is the body
290-
you would POST to `/v1/query` for a dynamic request; the same object appears
291-
inside `queries.json` under `read_routes.<name>` or `write_routes.<name>` for a
292-
stored route.
280+
you would POST to `/v1/query`; the same object appears inside a generated
281+
`queries.json` bundle under `read_routes.<name>` or `write_routes.<name>`.
293282

294283
You can also jump straight to any topic from the list below; the pages do not assume
295284
strict sequential reading, but anything earlier in the list is fair game later on.
@@ -319,6 +308,6 @@ strict sequential reading, but anything earlier in the list is fair game later o
319308
`repeat`, `union`, `choose`, `coalesce`, `optional`, `varAsIf`, `forEachParam`.
320309
</Card>
321310
<Card title="Parameters and bundles" icon="gear" href="/database/querying-guide/parameters-bundles">
322-
`defineParams`, stored bundles, dynamic requests, typed call helpers.
311+
`defineParams`, dynamic requests, bundles, typed call helpers.
323312
</Card>
324313
</CardGroup>

0 commit comments

Comments
 (0)