Tutorial
You will start a local HelixDB server, create two User nodes connected by a
FOLLOWS edge, and read them back with one of the forthcoming v3 SDKs.
Prerequisites
- Docker or Podman
- Rust, Node.js 20+, Go, Python 3.11+, or the
helixCLI for raw JSON
1
Install the CLI
2
Setup a local project
you can choose a language to use with the
--lang flag. The default is TypeScript.3
Start the local database
http://localhost:6969/.4
Create and query the graph
In the generated after running
helix init local, you will find a file called queries.rs (the file suffix will be different depending on the language you chose).
For the language you chose, paste the following code into the file:5
Run the query
you need to run this in the directory created by
helix init local.6
Open the dashboard
http://localhost:3000/. You can explore the graph and query it with the UI.What just happened
writeBatch()made invalid read-only mutation states unrepresentable.- Each
varAsadded one named query entry. NodeRef.var("alice")referred to the result of the first entry.- Each chained operation wrapped the preceding operation as
input. returning(...)selected the named values in the response.- The
followentry still ran even though it was not returned.
Clean up
Next steps
Data model
Learn how nodes, edges, labels, and properties fit together.
Writing data
Add, update, and remove graph data.
Reading data
Select data by ID, label, or indexed property.
Use another SDK
Switch to Rust, Go, or Python with the same query model.