TL;DR
- Strongly typed: All queries are type-checked at compile time
- Compiled: Queries are compiled to efficient bytecode for execution
- Graph & Vector: Native support for both graph and vector operations
- Inspired by Gremlin, Cypher and Rust
Example Query Syntax:
Query Components
QUERY: Keyword to start a query definitionQueryName: Identifier for the queryparameters: Input parameters in parenthesesType: Type of the parameter (e.g.String,I32,F64,Boolean,[Type]or schema Node/Edge)=>: Separates query header from body<-: Assignment operatorRETURN: Specifies output values//: Comments
Rule
- Query names are case-sensitive. SDK/cURL must match the query name in
query.hxexactly.
HelixQL Types
@tags: types, id, date, string, boolean, i8, i16, i32, i64, f32, f64, u8, u16, u32, u64, u128, arrayID: UUID for nodes, edges and vectorsDate: Timestamp or RFC3339 stringString: Text dataBoolean: True/false valueI8: 8-bit signed integerI16: 16-bit signed integerI32: 32-bit signed integerI64: 64-bit signed integerF32: 32-bit floating pointF64: 64-bit floating pointU8: 8-bit unsigned integerU16: 16-bit unsigned integerU32: 32-bit unsigned integerU64: 64-bit unsigned integerU128: 128-bit unsigned integer[T]: Array of any type
Schema Definition (schema.hx)
@tags: schema, definition, nodes, edges, vectors, indexing, helixql, schema.hx, query.hxTL;DR
- Schema defines graph structure: nodes, edges, vectors
- Every entity has implicit
IDfield (not defined in schema) - Default values supported with
DEFAULTkeyword - Secondary indexing available for nodes only
- Use
INDEXkeyword for global secondary indexes - Use
//for comments
Node
Defines node types and their properties in the graph.Edge
Defines relationships between nodes and their properties.Vector
Defines the vector type.Default Values
Set default values for item fields usingDEFAULT keyword.
Example
Theage field uses default value 0 when not provided:
Secondary Indexing
Index node fields as global secondary indexes usingINDEX keyword.