From 95e1a17c3edda94e45381d8ae49dd85b03d982c0 Mon Sep 17 00:00:00 2001 From: ishaksebsib Date: Tue, 21 Oct 2025 13:45:46 +0300 Subject: [PATCH 1/3] fix(hql): compilation error for AddE with borrowed IDs in FOR loops --- helix-db/src/helixc/analyzer/utils.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/helix-db/src/helixc/analyzer/utils.rs b/helix-db/src/helixc/analyzer/utils.rs index f38f84904..e8a8b0fe9 100644 --- a/helix-db/src/helixc/analyzer/utils.rs +++ b/helix-db/src/helixc/analyzer/utils.rs @@ -97,7 +97,7 @@ pub(super) fn gen_id_access_or_param(original_query: &Query, name: &str) -> Gene false => GenRef::DeRef(format!("data.{name}")), }) } else { - GeneratedValue::Identifier(GenRef::Std(format!("{name}.id()"))) + GeneratedValue::Identifier(GenRef::Std(format!("{name}.inner()"))) } } From c988839bf570e0b7a5f8a18b634246811ee47048 Mon Sep 17 00:00:00 2001 From: ishaksebsib Date: Sun, 26 Oct 2025 15:48:43 +0300 Subject: [PATCH 2/3] revert(hql): Change AddE ID accessor back to .id() --- helix-db/src/helixc/analyzer/utils.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/helix-db/src/helixc/analyzer/utils.rs b/helix-db/src/helixc/analyzer/utils.rs index e8a8b0fe9..f38f84904 100644 --- a/helix-db/src/helixc/analyzer/utils.rs +++ b/helix-db/src/helixc/analyzer/utils.rs @@ -97,7 +97,7 @@ pub(super) fn gen_id_access_or_param(original_query: &Query, name: &str) -> Gene false => GenRef::DeRef(format!("data.{name}")), }) } else { - GeneratedValue::Identifier(GenRef::Std(format!("{name}.inner()"))) + GeneratedValue::Identifier(GenRef::Std(format!("{name}.id()"))) } } From a98d8026b385c101da7dd5834a1411ad035cbb8b Mon Sep 17 00:00:00 2001 From: ishaksebsib Date: Sun, 26 Oct 2025 15:49:54 +0300 Subject: [PATCH 3/3] feat(hql): Add .id() method to ID struct for unified accessor interface --- helix-db/src/utils/id.rs | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/helix-db/src/utils/id.rs b/helix-db/src/utils/id.rs index f6eb980d0..e29035f86 100644 --- a/helix-db/src/utils/id.rs +++ b/helix-db/src/utils/id.rs @@ -25,6 +25,10 @@ impl ID { self.0 } + pub fn id(&self) -> u128 { + self.0 + } + pub fn stringify(&self) -> String { uuid::Uuid::from_u128(self.0).to_string() } @@ -117,14 +121,12 @@ pub fn v6_uuid() -> u128 { uuid::Uuid::now_v6(&[1, 2, 3, 4, 5, 6]).as_u128() } - #[cfg(test)] mod tests { use sonic_rs::json; use super::*; - #[test] fn test_uuid_deserialization() { let uuid = json!({ "id": "1f07ae4b-e354-6660-b5f0-fd3ce8bc4b49" }); @@ -134,9 +136,11 @@ mod tests { id: ID, } - let deserialized: IDWrapper = sonic_rs::from_value(&uuid).unwrap(); - assert_eq!(deserialized.id.stringify(), "1f07ae4b-e354-6660-b5f0-fd3ce8bc4b49"); + assert_eq!( + deserialized.id.stringify(), + "1f07ae4b-e354-6660-b5f0-fd3ce8bc4b49" + ); } #[test] @@ -151,4 +155,4 @@ mod tests { assert_eq!(uuid.to_string(), "1f07ae4b-e354-6660-b5f0-fd3ce8bc4b49"); } -} \ No newline at end of file +}