diff --git a/helix-db/src/grammar.pest b/helix-db/src/grammar.pest index 342f0f71..800943e2 100644 --- a/helix-db/src/grammar.pest +++ b/helix-db/src/grammar.pest @@ -18,8 +18,7 @@ field_defs = { (field_def ~ ",")* ~ (field_def ~ ","?)? } field_def = { index? ~ identifier ~ ":" ~ param_type ~ (default)? } index= { "INDEX" } default = { "DEFAULT" ~ (now | float | integer | boolean | string_literal | none) } -// optional = { "OPTIONAL" } -properties = { "Properties" ~ ":" ~ "{" ~ field_defs? ~ "}" } +properties = { "Properties" ~ optional_param? ~ ":" ~ "{" ~ field_defs? ~ "}" } schema_version = { "schema::" ~ integer } // --------------------------------------------------------------------- @@ -231,11 +230,18 @@ mapping_field = { (identifier ~ (":" ~ (anonymous_traversal | evaluates_to_anyth // --------------------------------------------------------------------- built_in_macro = { mcp_macro | model_macro } mcp_macro = { "#[mcp]" } - model_macro = { "#[" ~ "model" ~ "(" ~ model_name ~ ")" ~ "]" } model_name = { identifier | string_literal } - +// --------------------------------------------------------------------- +// Match steps +// --------------------------------------------------------------------- +match_step = { "MATCH" ~ match_variable? ~ "{" ~ match_statements ~ "}" } +match_variable = { "|" ~ (identifier | traversal | "_") ~ "|" } +match_statements = { (match_statement ~ ",")* ~ match_statement ~ ","? } +match_statement = { match_type ~ "=>" ~ match_value } +match_type = { identifier_upper ~ "::" ~ identifier_upper ~ ("(" ~ identifier ~ ")")?} +match_value = { "{" ~ query_body ~ "}" | traversal | id_traversal | anonymous_traversal | none | identifier } // --------------------------------------------------------------------- // Types @@ -267,4 +273,3 @@ now = { "NOW" } // --------------------------------------------------------------------- WHITESPACE = _{ " " | "\t" | "\n" | "\r" } COMMENT = _{ "//" ~ (!"\n" ~ ANY)* } - diff --git a/helix-db/src/helix_engine/traversal_core/ops/util/update.rs b/helix-db/src/helix_engine/traversal_core/ops/util/update.rs index e79d5188..806bf1d3 100644 --- a/helix-db/src/helix_engine/traversal_core/ops/util/update.rs +++ b/helix-db/src/helix_engine/traversal_core/ops/util/update.rs @@ -1,5 +1,4 @@ use heed3::PutFlags; - use crate::{ helix_engine::{ traversal_core::{traversal_iter::RwTraversalIterator, traversal_value::TraversalValue}, diff --git a/hql-tests/tests/adding_chunk_to_memory/schema.hx b/hql-tests/tests/adding_chunk_to_memory/schema.hx index 585d8641..6faefc8a 100644 --- a/hql-tests/tests/adding_chunk_to_memory/schema.hx +++ b/hql-tests/tests/adding_chunk_to_memory/schema.hx @@ -1,6 +1,6 @@ // User node - represents users of the memory system with email indexing N::User { - email: String, + email?: String, name: String, created_at: String, updated_at: String,