Skip to content

v0.4.1

Choose a tag to compare

@github-actions github-actions released this 29 Mar 19:53
· 117 commits to main since this release

What's New

CALL {} Subquery Support (openCypher)

Full implementation of CALL {} subqueries — a core openCypher feature for batch operations, correlated subqueries, and conditional writes.

-- Write-only: SET properties via outer variable binding
MATCH (n:Person) CALL { WITH n SET n.processed = true }

-- UNION branches inside CALL
MATCH (c:Company) CALL {
  WITH c MERGE (c)-[:HAS_DEPT]->(:Dept {name: "Eng"})
  UNION
  WITH c MERGE (c)-[:HAS_DEPT]->(:Dept {name: "Sales"})
}

-- Standalone with RETURN
CALL { MATCH (n:Person) RETURN n.name ORDER BY n.name LIMIT 5 }

-- Nested CALL
CALL { CALL { RETURN 42 AS answer } }

Supported patterns:

  • Standalone CALL { ... } with inner MATCH, RETURN, CREATE
  • MATCH + CALL { WITH ... SET/MERGE/CREATE } — outer variable binding per row
  • CALL { ... UNION ... } — execute multiple branches with shared WITH imports
  • WITH a AS x aliasing inside CALL scope
  • Nested CALL { CALL { ... } }
  • Scope isolation: variables not imported via WITH are inaccessible

CREATE...RETURN Support

CREATE (n:Label {props}) RETURN n.prop now works — previously returned "not yet implemented". This also unblocked the functional test suite which was silently stopping at test 26.

Structured JSON Error Codes

All error responses from the C extension now return structured JSON with error codes:

{"error": "Line 1, Col 6: syntax error", "code": "PARSE_ERROR"}

Architecture Hardening

From the architecture review (Wave 3):

  • REC-02: Fixed integer overflow, unchecked realloc, and O(n²) strcat in result serialization
  • REC-03/04/05: Eliminated strict-aliasing violations and fixed-size truncation buffers
  • REC-07: Added scale guards for O(N²) graph algorithms
  • REC-08: Migrated Graph API to parameterized queries (SQL injection prevention)
  • REC-09: Deleted unused bundled_init.c (593 lines of dead code)
  • REC-10: Single-pass result enumeration in build_query_results
  • REC-11: Structured JSON error codes from C extension
  • REC-12: Schema versioning via PRAGMA user_version
  • REC-13: Hardened Rust extension extraction with atomic write and fallback
  • REC-14: Migrated all static transform globals into per-query context (thread safety)

Test Coverage

  • 926 CUnit tests (up from 770)
  • 44 functional SQL test files (all running — previously stopped at test 26)
  • 332 Python binding tests
  • 233 Rust binding tests

Breaking Changes

None. All existing APIs are backward compatible.

Full Changelog

v0.4.0...v0.4.1